[SwitchA]vlan 2
[SwitchA-vlan2]port e0/3 to e0/4
[SwitchA]vlan 3
[SwitchA-vlan3]port e0/5 to e0/6
[SwitchB]vlan 2
[SwitchB-vlan2]port e0/3 to e0/4
[SwitchB]vlan 3
[SwitchB-vlan3]port e0/5 to e0/6
设置计算机的IP为:
PCA:10.65.1.1 PCB:10.66.1.1 PCC:10.65.1.3 PCD:10.66.1.3
[root@PCA root]#ping 10.65.1.1 通 (本机IP)
[root@PCA root]#ping 10.65.1.3 不通 (中间连接线是vlan 1)
[root@PCA root]#ping 10.66.1.1 不通 (不同网络,不同vlan)
[root@PCA root]#ping 10.66.1.3 不通 (不同网络,不同vlan)
[root@PCB root]#ping 10.66.1.3 不通 (中间连接线是vlan 1)
将PCA改接到SwitchA E0/2 (vlan 1)
[root@PCA root]#ping 10.65.1.3 不通 (同网络,不同vlan)
将PCC改接到SwitchB E0/2 (vlan 1)
[root@PCA root]#ping 10.65.1.3 通 (同网络,同在vlan 1)
再改回来,并设置trunk:
[S3026A]interface ethernet 0/8
[S3026A-Ethernet0/8]port link-type trunk
[S3026A-Ethernet0/8]port trunk permit vlan all
[S3026B]interface ethernet 0/1
[S3026B-Ethernet0/1]port link-type trunk
[S3026B-Ethernet0/1]port trunk permit vlan all
[root@PCA root]#ping 10.65.1.3 通
[root@PCA root]#ping 10.66.1.3 不通
[root@PCB root]#ping 10.66.1.3 通