使用TRUNK连接多台交换机VLAN(Vlan + Trunk)

注意:使用了路由器去模拟PC主机
步骤一:配置各PC的IP地址。
步骤二:在pc1上ping其它的主机结果是全部通的。
步骤三:将switch1和switch2的fa0/12的直连接口指定为干道
sw1(config)#inte fa0/12 sw1(config-if)#switchport trunk encapsulation dot1q sw1(config-if)#switchport mode trunk sw1(config-if)#exit sw2(config)#inte fa0/12 sw2(config-if)#switchport trunk encapsulation dot1q sw2(config-if)#switchport mode trunk sw2(config-if)#exit |
sw1#show interfaces trunk Port Mode Encapsulation Status Native vlan Fa0/12 on 802.1q trunking 1 Port Vlans allowed on trunk Fa0/12 none Port Vlans allowed and active in management domain Fa0/12 none Port Vlans in spanning tree forwarding state and not pruned Fa0/12 none sw2#show interfaces fastethernet0/12 switchport Name: Fa0/12 Switchport: Enabled Administrative mode: trunk Operational mode: trunk Administrative Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Trunking VLANs Enabled: ALL Pruning VLANs Enabled: 2-1001 Protected: false Voice vlan: none (Inactive) Appliance trust: none |
步骤四:使用ping去确认
PC1 PC2 PC5 PC6 可以相互PING通 |
相互不能PING通 |
PC3 PC4 PC7 PC8 可以相互PING通 |