1、配置vlan的2种方法
1) 在全局模式下配置vlan
sw1(config)#vlan vlan-id //添加一个vlan
sw1(config-vlan)# name vlan-name //给vlan取个名字
2)在vlan数据库创建vlan
sw1#vlan database //进入vlan数据库
sw1(vlan)#vlan vlan-id name qq //添加一个vlan 名字为qq
sw1(vlan)#exit
2、删除已创建的vlan
sw1#vlan database
sw1(vlan)# no vlan vlan-id
或者可以 sw1(config)#no vlan 2
3、将端口加入到vlan
sw1(config)#int f0/1 //进入端口模式
sw1(config-if)#swi acc vlan vlan-id //把端口加入到某个vlan
swi(config-if)#no swi acc vlan vlan-id //将端口从某个vlan上删除
要同时把多个端口加入到某个vlan:
sw1(config)#int range f0/0-10
sw1(config-if-range)#swi acc vlan vlan-id
4、查看vlan的配置信息
sw1#show vlan brief
swi#show vlan vlan-id
5、配置接口为trunk模式
sw1(config)#int interface-id
sw1(config-if)#swichport mode trunk
6、查看接口模式
sw1#show interface interface-id swichpor
7、从TRUNK中添加、删除vlan
sw1(config-if)swichport trunk allowed vlan remove vlan-list //删除vlan
sw1(config-if)swichport trunk allowed vlan add vlan-list //添加vlan
阅读(4070) | 评论(0) | 转发(0) |