通过子接口实现不同vlan间互通的例子不同Vlan间互通可以通过vlanif接口来实现,也可以通过路由器的子接口来实现,下面的例子通过子接口来实现vlan10和vlan20之间互通,交换机的GE0/0/1接口允许通过vlan10,vlan20,在路由器AR1的GE0/0/0上做子接口来实现不同vlan间的互通,拓扑图如下:1.按图配置好电脑PC1、PC2的地址PC1:IP-192.168.10.2,Mask-255.255.255.0,GW-192.168.10.1PC2:IP-192.168.20.2,Mask-255.255.255.0,GW-192.168.20.12.S5700交换机的配置如下:sysvlanbatch1020undoinfo-centerenableinterfacevlanif10qinterfacegiga0/0/2porthybriduntaggedvlan10//设置当前接口为hybrid模式,其中vlan10出接口时untagged(就是去tag)porthybridpvidvlan10//将Hybrid端口giga0/0/2的默认VLAN设为10interfacegiga0/0/3porthybriduntaggedvlan20porthybridpvidvlan20interfacegiga0/0/1portlink-typetrunkporttrunkallow-passvlan1020q3.路由器AR2220配置:在路由器的GE0/0/0接口上配置两个子接口,使子接口能够与vlan进行数据对接,配置如下sysundoinfo-centerenableInfo:Informationcenterisdisabled.interfacegiga0/0/0.10dot1qterminationvid10ipaddress192.168.10.124arpbroadcastenableinterfacegiga0/0/0.20dot1qterminationvid20ipaddress192.168.20.124arpbroadcastenableq