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