实现不同VLAN间通信——三层交换机(2)

该实现vlan间通信方法的图解如下图。

实现不同VLAN间通信——三层交换机(2)_第1张图片

设置普通交换机连接三层交换机的端口为trunk模式。(这里省略了普通交换机上对vlan的划分)

Switch1(config-if)#switchport trunk encapsulation dot1q
Switch1(config-if)#switchport mode trunk

Switch2(config-if)#switchport trunk encapsulation dot1q
Switch2(config-if)#switchport mode trunk

在三层交换机上配置路由端口

Switch3(config)#vlan 10
Switch3(config-if)#ip address 172.25.10.254 255.255.255.0
Switch3(config-if)#no shutdown

Switch3(config)#vlan 20
Switch3(config-if)#ip address 172.25.20.254 255.255.255.0
Switch3(config-if)#no shutdown

开启路由功能

Switch3(config)#ip routing
通过show ip route 查看路由信息如下图

实现不同VLAN间通信——三层交换机(2)_第2张图片

然后就可以通过vlan1去ping vlan2中的主机 ,验证是否可以通信了。

你可能感兴趣的:(实现不同VLAN间通信——三层交换机(2))