拓撲圖
用三層交換機實現vlan間的通信
首先要用到vtp協議
switch 1 配置
Switch(config)#vtp domain test
switch 2 配置
Switch(config)#vtp domain test
Changing VTP domain name from NULL to test
Switch(config)#vtp mode client
Setting device to VTP CLIENT mode.
Switch(config)#
switch 3 ,4,5與2一致
在switch 1上創建vlan
Switch(config)#
Switch(config)#vlan 10
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#exit
Switch(config)#vlan 30
Switch(config-vlan)#exit
在switch 5和switch 4 上配置中繼鏈路
switch 5
Switch(config)#
Switch(config)#int range f0/1-3
Switch(config-if-range)#switchport mode trunk
switch 4
Switch(config)#
Switch(config)#int f0/24
Switch(config-if)#switchport mode trunk
在switch 1上為vlan10,20,30設置地址(這個地址便是各個vlan的網管)
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up
Switch(config-if)#exit
Switch(config)#int vlan 20
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up
Switch(config-if)#exit
Switch(config)#int vlan 30
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan30, changed state to up
Switch(config-if)#ip addr 192.168.3.254 255.255.255.0
Switch(config-if)#exit
打開三層路由器的路由轉發工能
Switch(config)#ip routing
配置結束,用ping命令檢查實驗結果
pc 1 ping pc 6
vlan10 可與vlan 30 通信
pc2 ping pc7
vlan 10 可與vlan 20 通信
vlan間通信以實現,實驗完成