SW1配置
vlan batch 2 to 3 100 interface GigabitEthernet0/0/1 port hybrid tagged vlan 2 to 3 100 # interface GigabitEthernet0/0/2 port hybrid pvid vlan 2 port hybrid untagged vlan 2 100 # interface GigabitEthernet0/0/3 port hybrid pvid vlan 3 port hybrid untagged vlan 3 100 #
SW2配置
vlan batch 2 to 3 100 interface GigabitEthernet0/0/1 port hybrid tagged vlan 2 to 3 100 # interface GigabitEthernet0/0/2 port hybrid pvid vlan 100 port hybrid untagged vlan 2 to 3 100 #
PC1测试
PC>ping 192.168.1.100 Ping 192.168.1.100: 32 data bytes, Press Ctrl_C to break From 192.168.1.100: bytes=32 seq=1 ttl=128 time=78 ms From 192.168.1.100: bytes=32 seq=2 ttl=128 time=46 ms From 192.168.1.100: bytes=32 seq=3 ttl=128 time=78 ms From 192.168.1.100: bytes=32 seq=4 ttl=128 time=78 ms From 192.168.1.100: bytes=32 seq=5 ttl=128 time=62 ms --- 192.168.1.100 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 46/68/78 ms PC>ping 192.168.1.3 Ping 192.168.1.3: 32 data bytes, Press Ctrl_C to break From 192.168.1.2: Destination host unreachable From 192.168.1.2: Destination host unreachable From 192.168.1.2: Destination host unreachable From 192.168.1.2: Destination host unreachable From 192.168.1.2: Destination host unreachable --- 192.168.1.3 ping statistics --- 5 packet(s) transmitted 0 packet(s) received 100.00% packet loss