收藏 分享(赏)

交换机配置(常用).doc

上传人:hskm5268 文档编号:6651260 上传时间:2019-04-19 格式:DOC 页数:3 大小:43KB
下载 相关 举报
交换机配置(常用).doc_第1页
第1页 / 共3页
交换机配置(常用).doc_第2页
第2页 / 共3页
交换机配置(常用).doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

1、1交换机配置命令(常用)一、电缆连接及终端配置:PC 机的串口 1(COM1)-Console 端口Console 端口默认参数:端口速率( 9600b/s) ;数据位(8 ) ;奇偶检验(无) ;停止位(1) ;流控(无) 。二、交换机的基本配置:1、配置 enable 口令和主机名switchenable /进入特权模式switch# /特权模式提示符switch#config terminal /进入全局配置模式switch(config)#enable password xxa /设置特权非密口令switch(config)#enable secret xxx /设置特权加密口令swi

2、tch(config)#hostname switch /设置交换机的主机名switch (config)#end /返回到特权模式switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令 xxswitch#exit ;返回命令2、配置交换机 IP 地址、默认网关、域名、域名服务器switch (config)#ip address 192.168.1.1 2

3、55.255.255.0 /设置交换机 IP 地址switch (config)#ip default-gateway 192.168.1.254 /设置默认网关switch (config)#ip domain-name /设置域名switch (config)#ip name-server 200.0.0.1 /设置域名服务器3、配置交换机的端口属性switch (config) # interface fastethernet0/1 /进入接口 0/1 的配置模式switch (config-if)# speed ? /查看 speed 命令的子命令switch (config-if)

4、# speed 100 /设置该端口速率为 100Mb/sswitch (config-if)# dulplex full/half/auto /设置该端口为全双工 switch (config-if)# description TO_PC1 /设置该端口描述为 TO_PC1switch (config-if)#Z /返回特权模式,同 endswitch # show interface fastethernet0/1 /查看端口 0/1 的配置结果switch # show interface fastethernet0/1 status /查看端口 0/1 的状态3、配置和查看 MAC 地

5、址表:switch (config)# mac-address-table? /查看 MAC 地址表的子命令switch (config)# mac-address-table aging-time 100 /设置超时是时间为 100sswitch (config)# mac-address-table permanent 0000.0c01.cc f0/3 /加入永久地址switch (config)# mac-address-table restricted static 0000.0c02.bbcc f0/6 f0/7 /加入静态地址switch #show mac-address-ta

6、ble 查看整个 MAC 地址表switch #clear mac-address-table restricted static 清除限定性地址2三、配置和管理 VLAN1、配置 VTP(VLAN Trunking中继 Protocol)协议switch # vlan database /进入 VLAN 配置子模式switch(vlan) # vtp? /查看和 VTP 配合任用的命令switch (vlan)# vtp server/client /设置本交换机为 server/client 模式(选择一种,如果是 client 模式可用设置域名和启动修剪功能)switch (vlan)#

7、 vtp domain vtpserver /设置域名switch (vlan)# vtp pruning /启动修剪功能switch (vlan)# exit /退出 VLAN 配置模式switch# show vtp status /查看 VTP 设置信息2、配置 VLAN Trunk 端口Switch(config)#interface f0/24 /进入端口 24 配置模式Switch(config-if)#switchport mode trunk /设置当前端口为 Trunk 模式Switch(config-if)#switchport trunk allowed vlan all

8、 /设置允许从该端口交换数据的 VLANSwitch (config)# exit /退出配置模式2950(config-if)#switchport trunk encapsulation dot1q | isl | negotiate (设置 TRUNK 封装)3、创建 VLANswitch # vlan database /进入 VLAN 配置子模式switch(vlan) # vlan 2 /创建 VLAN2,系统将自动命名switch(vlan) # vlan 3 name vlan3 /创建 VLAN3,并命名为 vlan34、将端口加入到某个 VLAN 中Switch(confi

9、g)#interface f0/9 /进入端口 9 的配置模式Switch(config-if)# switchport /mode access /设置端口为静态 VLAN 访问模式Switch(config-if)# switchport /access vlan2 /将端口 9 分配该 VLAN2Switch(config-if)# exitSwitch (config)# exitSwitch# show vlan /查看 VLAN 配置信息四、生成树协议 STP 配置1、使用 STP 端口权值实现负载均衡Switch(config)#interface f0/23Switch(con

10、fig-if)# spanning-tree vlan 1 port-priority 10 /将 VLAN 1 的端口权值设为 10Switch(config-if)# spanning-tree vlan 2 port-priority 10 Switch(config-if)# exitSwitch(config)#interface f0/24Switch(config-if)# spanning-tree vlan 3 port-priority 10 /将 VLAN 3 的端口权值设为 10Switch(config-if)# spanning-tree vlan 4 port-p

11、riority 10 Switch(config-if)# spanning-tree vlan 5 port-priority 10 Switch(config-if)# end3Switch # copy running-config startup-config /保存配置文件Switch (config-if)# spanning-tree vlan 1 2 port-priority 102、配置 STP 路径值的负载均衡Switch(config)#interface f0/23Switch(config-if)# spanning-tree vlan 3 cost 30 /设置

12、VLAN 3 生成树路径值为 30Switch(config-if)# spanning-tree vlan 4 cost 30 Switch(config-if)# spanning-tree vlan 5 cost 30 Switch(config-if)# exitSwitch(config)#interface f0/24Switch(config-if)# spanning-tree vlan 1 cost 30 /设置 VLAN 1 生成树路径值为 30Switch(config-if)# spanning-tree vlan 2 cost 30 Switch(config-if)

13、# endSwitch_1(config-if)# spanning-tree vlan 3 4 5 cost 30五、其它1.在基于 IOS 的交换机上设置远程访问: switch(config)# interface vlan 1 switch(config-if)# ip address ip-address netmask switch(config-if)# ip default-gateway ip-address2.在基于 IOS 的交换机上启用和浏览 CDP 信息: switch(config-if)# cdp enable switch(config-if)# no cdp enable 为了查看 Cisco 邻接设备的 CDP 通告信息: switch# show cdp interface type modle/port switch# show cdp neighbors type module/port detail 3.在基于 IOS 的交换机上设置端口速度: switch(config-if)# speed10|100|auto4.在基于 IOS 的交换机上设置以太网的链路模式: switch(config-if)# duplex auto|full|half

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 企业管理 > 管理学资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报