| 交换机常见配置命令 |
|
| 作者: 出处: 更新时间: 2008年08月26日 |
在这里我只总结了常用的switch命令
1.设置主机名/系统名:  在基于IOS的交换机上switch(config)# hostname hostname (主机名) 在基于CLI的交换机上switch(enable) set system name name-string  2.设置登录口令:  在基于IOS的交换机上switch(config)# enable password level 1 password  在基于CLI的交换机上switch(enable) set password                        switch(enable) set enalbepass 需要设置二级密码 3.设置远程访问:  在基于IOS的交换机上switch(config)# interface vlan 1  switch(config-if)# ip address ip-address netmask  switch(config-if)# ip default-gateway ip-address  在基于CLI的交换机上 switch(enable) set interface sc0 ip-address netmask broadcast-address  switch(enable) set interface sc0 vlan  switch(enable) set ip route default gateway  4.设置端口速度:  在基于IOS的交换机上switch(config-if)# speed{10|100|auto}  在基于CLI的交换机上 switch(enable) set port speed moudle/number {10|100|auto}  switch(enable) set port speed moudle/number {4|16|auto} 5.设置以太网的链路模式:  在基于IOS的交换机上switch(config-if)# duplex {auto|full|half} (自动|全双工|半双工) 在基于CLI的交换机上switch(enable) set port duplex module/number {full|half}  6.配置静态VLAN:  在基于IOS的交换机上 switch# vlan database  switch(vlan)# vlan vlan-num name vla  switch(vlan)# exit  switch# configure teriminal  switch(config)# interface interface module/number  switch(config-if)# switchport mode access  switch(config-if)# switchport access vlan vlan-num  switch(config-if)# end  在基于CLI的交换机上 switch(enable) set vlan vlan-num [name name] (命令字,vlan号,名字) switch(enable) set vlan vlan-num mod-num/port-list  7.配置VLAN中继线:  在基于IOS的交换机上 switch(config)# interface interface mod/port  switch(config-if)# switchport mode trunk  switch(config-if)# switchport trunk encapsulation {isl|dotlq}  switch(config-if)# switchport trunk allowed vlan remove vlan-list  switch(config-if)# switchport trunk allowed vlan add vlan-list  在基于CLI的交换机上(在哪个端口上设置trunk) switch(enable) set trunk module/port [on|off|desirable|auto|nonegotiate]  Vlan-range [isl|dotlq|dotl0|lane|negotiate]  8.配置VTP管理域:  在基于IOS的交换机上 switch# vlan database  switch(vlan)# vtp domain domain-name  在基于CLI的交换机上 switch(enable) set vtp [domain domain-name]  9.配置VTP 模式:  在基于IOS的交换机上 switch# vlan database  switch(vlan)# vtp domain domain-name  switch(vlan)# vtp {sever|cilent|transparent}  switch(vlan)# vtp password password  在基于CLI的交换机上 switch(enable) set vtp [domain domain-name] [mode{ sever|cilent|transparent }][password password] 注:vtp有三种模式:客户端模式,服务器模式,透明模式 10. 为了从一条中继链路上删除VLAN,可使用下列命令:  switch(enable) clear trunk module/port vlan-range  11.显示管理域的VTP参数. show vtp statistics 12. 用物理接口建立与VLAN的连接:  router# configure terminal  router(config)# interface media module/port  router(config-if)# description description-string  router(config-if)# ip address ip-addr subnet-mask  router(config-if)# no shutdown  13.在路由处理器上进行动态路由配置,用下列IOS命令进行:  router(config)# ip routing  router(config)# router ip-routing-protocol  router(config-router)# network ip-network-number  router(config-router)# network ip-network-number  14. 配置默认路由:  switch(enable) set ip route default gateway 15. 配置HSRP跟踪:  router(config-if)# standy group-number track type-number interface-priority  16. 在Cisco设备上设置控制台及vty端口的会话超时:  R1(config)# line console 0  R1(config-line)# exec-timeout 5 10  R1(config)# line vty 0 4(设置对话时间) R1(config-line)# exec-timeout 5 2 17. 显示SPAN信息:  Consile> show spantree
(本文已被浏览 26 次)
|
|
|
|
|
| | | |
|