拓扑图
用三层交换机实现vlan间的通信
首先要用到vtp协议
switch 1 配置
Switch(config)#vtp domain test
switch 2 配置
Switch(config)#vtp domain testChanging VTP domain name from NULL to testSwitch(config)#vtp mode clientSetting device to VTP CLIENT mode.Switch(config)#
switch 3 ,4,5与2一致
在switch 1上创建vlan
Switch(config)#Switch(config)#vlan 10Switch(config-vlan)#exitSwitch(config)#vlan 20Switch(config-vlan)#exitSwitch(config)#vlan 30Switch(config-vlan)#exit
在switch 5和switch 4 上配置中继链路
switch 5
Switch(config)#Switch(config)#int range f0/1-3Switch(config-if-range)#switchport mode trunk
switch 4
Switch(config)#Switch(config)#int f0/24Switch(config-if)#switchport mode trunk
在switch 1上为vlan10,20,30设置地址(这个地址便是各个vlan的网管)
witch(config)#int vlan 10 Switch(config-if)# %LINK-5-CHANGED: Interface Vlan10, changed state to up Switch(config-if)#ip addr 192.168.1.254 255.255.255.0 Switch(config-if)#exit Switch(config)#int vlan 20 Switch(config-if)# %LINK-5-CHANGED: Interface Vlan20, changed state to up Switch(config-if)#ip addr 192.168.2.254 255.255.255.0 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间通信以实现,实验完成
转载于:https://www.cnblogs.com/knightysa/p/9178815.html
相关资源:路由 通过三层交换机实现VLAN间通信