vlan acess端口的設置

vlan acess端口的設置

步驟
創建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通
完成了公司不同部門網絡的隔離

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章