主要讲思科二层交换机中VLAN的配置,以下括号内的是说明,不用输
1、创建多个VLAN
Switch>enable (进入特权模式)
Switch#vlan data (进入vlan配置模式)
Switch(vlan)#vlan 10 name IT (划分vlan10,名称为IT)
Switch(vlan)#vlan 20 name HR (划分vlan20,名称为HR)
Switch(vlan)#vlan 30 name FIN (划分vlan30,名称为FIN)
Switch(vlan)#vlan 40 name LOG (划分vlan40,名称为LOG)
Switch(vlan)#exit
Switch#wr
2、分配端口为VLAN
Switch#config terminal
Switch(config)#interface f0/1 (进入端口f0/1)
Switch(config-if)#switchport access vlan 10 (端口f0/1分给vlan10)
Switch(config-if)#interface f0/2 (进入端口f0/2)
Switch(config-if)#switchport access vlan 20 (端口f0/2分给vlan20)
Switch(config-if)#interface f0/3 (进入端口f0/3)
Switch(config-if)#switchport access vlan 30 (端口f0/3分给vlan30)
Switch(config-if)#interface f0/4 (进入端口f0/4)
Switch(config-if)#switchport access vlan 40 (端口f0/4分给vlan40)
Switch(config-if)#end
Switch#show vlan bri (查看VLAN信息)
Switch(config)#int range f0/5 - 8 (进入端口f0/5 - f0/8)
Switch(config-if-range)#switchport mode access (配置端口f0/5 - f0/8模式为access)
Switch(config-if-range)#switchport access vlan 10 (分配端口f0/5 - f0/8给vlan10)
Switch(config-if-range)#exit
Switch(config)#int g0/1 (进入端口g0/1)
Switch(config-if)#switchport mode trunk (配置端口g0/1模式为trunk)
Switch(config-if)#end
3、从VLAN中删除端口
Switch#config terminal
Switch(config)#interface f0/1 (进入端口f0/1)
Switch(config-if)#no switchport access vlan 10 (把端口f0/1从vlan10中删除)
Switch(config-if)#end
Switch#show vlan bri (显示端口已经回到默认的vlan1)
4、删除VLAN
Switch#vlan data
Switch(vlan)#no vlan 10
Switch(vlan)#exit
Switch#show vlan bri (显示端口f0/5 - f0/8未回到默认vlan1)
Switch#show int status (显示端口f0/5 - f0/8还在vlan10)
谢谢赞赏
(微信扫一扫或长按识别)