码迷,mamicode.com
首页 > 其他好文 > 详细

vlan acess端口的设置

时间:2018-10-12 11:04:02      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:water   vpd   size   创建   The   51cto   技术分享   group   分享   

技术分享图片

步骤
创建vlan2 vlan3
将端口0/0/1加入VLAN2
端口0/0/2加入VLAN2
将端口0/0/3加入VLAN3
端口0/0/4加入VLAN3
[Sw1]vlan batch 2 3
[sw1]interface e0/0/1
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/1]port default vlan 2
[sw1-Ethernet0/0/2]port lin1k-type access
[sw1-Ethernet0/0/2]port default vlan 2
[sw1-Ethernet0/0/3]port link-type access
[sw1-Ethernet0/0/3]port default vlan 3
[sw1-Ethernet0/0/4]port link-type access
[sw1-Ethernet0/0/4]port default vlan 4

实验结果:
PC机1能PING通PC机2
PC机2也能PING通PC机1
PC机3能PING通PC机4
PC机4能PING通PC机3
实验结果实现了不通VLAN不能PING通
同一VLAN可以ping通
完成了公司不同部门网络的隔离

还有一种方法是批量将端口加入vlan
先要创建group 1
把0/0/1 0/0/2加入group 1
并给group 1 配上vlan 2
把0/0/3 0/0/4 加入group 2
并给grop 2配上vlan 3
具体操作如下:
[Sw1]vlan batch 2 3
[sw1]port-group 1
[sw1-group-1]group-member e0/0/1 e0/0/2
[sw1-Ethernet0/0/1] Port link-type access
[sw1-Ethernet0/0/2] Port link-type access
[sw1-Ethernet0/0/1]port default vlan 2
[sw1-Ethernet0/0/2]port default vlan 2
[sw1]port-group 2
[sw1-group-2]group-member e0/0/3 e0/0/4
[sw1-Ethernet0/0/3]port default vlan 3
[sw1-Ethernet0/0/4]port default vlan 3

OK
得到的结果和上面的实验是一样的
实验结果:
PC机1能PING通PC机2
PC机2也能PING通PC机1
PC机3能PING通PC机4
PC机4能PING通PC机3
实验结果实现了不通VLAN不能PING通
同一VLAN可以ping通
完成了公司不同部门网络的隔离

vlan acess端口的设置

标签:water   vpd   size   创建   The   51cto   技术分享   group   分享   

原文地址:http://blog.51cto.com/13935936/2299002

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!