switch(config)# hostname 主机名
switch(config)# enable password 口令
switch(config)# enable secret 口令
switch(config)# interface vlan 1
switch(config-if)# ip address ip-address netmask
switch(config-if)# ip default-gateway ip-address
switch(config)# cluster enable cluster-name
switch(config-if)# description description-string
switch(config-if)# speed{10|100|auto}
switch(config-if)# duplex {auto|full|half}
switch# vlan database
switch(vlan)# vlan vlan-id name vla-name
switch(vlan)# exit
switch# configure teriminal
switch(config)# vlan vlan-id
switch(config)# name vlan-name
switch(config)#interface type slot/port
switch(config-if)# switchport access vlan vlan-id
switch(config-if)# end
switchport mode acccess
switchport access vlan 20
注意,f0/1后面有个空格,然后才是-10
10.在基于IOS的交换机上配置VLAN中继链路
switch(config-if)# switchport mode trunk
switch(config-if)# switchport trunk encapsulation {isl|dotlq}
注:trunk,中继链路默认承载所有vlan的数据。
switch(config-if)# switchport trunk allowed vlan remove vlan-list
switch(config-if)# switchport trunk allowed vlan add vlan-list
11.在基于IOS的交换机上配置VTP管理域
switch(config)# vtp domain domain-name
switch(config)# vtp mode {sever|cilent|transparent}
switch(config)# vtp password 密码
switch(config# vtp pruning
switch(config# vtp version 2
12.配置以太信道(将多个物理接口逻辑捆绑在一起)
switch(config-if-range)# channel-group 1 mode on
13.STP的配置命令
switch(config)#spanning-stree vlan vlan-list
switch(config)#spanning-tree vlan vlan-list root primary | secondary
switch(config)#spanning-tree vlan vlan-list priority bridge-priority
switch(config-if)#spanning-tree vlan vlan-list cost 端口成本
switch(config)#spanning-tree vlan vlan-list port-priority priority
switch(config)#spanning-tree uplinkfast
switch(config-if)#spanning-tree portfast
14.show命令
switch# show run
switch# show int status
switch# show mac-address-table
switch# show vlan
switch# show int f0/0 switchport
switch# show vtp status
switch# show etherchannel 1 summary
switch# show spanning-tree