实验拓扑
实验步骤
SW1
<Huawei>sys
[Huawei]sys sw1
[sw1]vlan batch 10 20
[sw1]int e0/0/1
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/1]port default vlan 10
[sw1-Ethernet0/0/1]int e0/0/2
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/2]port default vlan 10
[sw1-Ethernet0/0/2]int e0/0/3
[sw1-Ethernet0/0/3]port link-type access
[sw1-Ethernet0/0/3]port default vlan 20
[sw1-Ethernet0/0/3]int e0/0/4
[sw1-Ethernet0/0/4]port link-type access
[sw1-Ethernet0/0/4]port default vlan 20
[sw1-Ethernet0/0/4]q
[sw1]int vlan 10
[sw1-Vlanif10]ip add 192.168.1.254 24
[sw1-Vlanif10]int vlan 20
[sw1-Vlanif20]ip add 192.168.2.254 24
[sw1-Vlanif20]q
[sw1]
[sw1]
实验结果
不同vlan可以通信