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



注意:使用了路由器去模拟
PC主机

步骤一:配置各PCIP地址。
步骤二:在pc1ping其它的主机结果是全部通的。
步骤三:将switch1switch2fa0/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

步骤四:使用show interface trunkshow interface fa0/12 switchport命令查看确认干道

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

步骤三:在switch1switch2上创建vlan 10 vlan 20,并将端口按图加入到相应的VLAN
步骤四:使用ping去确认

      

PC1              PC2              PC5              PC6 可以相互PING

相互不能PING





PC3              PC4              PC7              PC8 可以相互PING

posted on 2007-10-20 09:36  kyovcs  阅读(1671)  评论(1)    收藏  举报

导航