单臂路由实现不同VLAN间通讯,本来跨vlan是不能通讯的,相同VLAN才能通讯

单臂路由就是在路由器以太网接口下配置若干个子接口,每个子接口对应一个VLAN,这样当路由器的以太网口连接到一个划分VLAN的二层交换机时,可以通过路由器的以太网口,实现二层交换机上多个VLAN之间的互通。 而三层交换机的VLAN之间互通,则不需要路由器的配合,可在三层交换机上直接配置VLAN虚接口,每个VLAN一个虚接口,并指定IP,通过VLAN虚接口实现交换机各个VLAN之间的互通。臂路由,即在路由器上设置多个逻辑子接口,每个子接口对应一个vlan。在每个子接口的数据在物理链路上传递都要标记封装。Cisco设备支持ISL和802.1q(dot1Q)协议。华为只支持802.1q。

 

单臂路由实现不同VLAN间通讯,本来跨vlan是不能通讯的,相同VLAN才能通讯

S1:

 

Switch>enable

Switch#vlan database

Switch(vlan)#vlan 30

Switch(vlan)#vlan 40

Switch# configure terminal

Switch(config)#int fastEthernet 0/1

Switch(config-if)#switchport access vlan 30

Switch(config-if)#int f0/2

Switch(config-if)#switchport access vlan 40

Switch(config-if)#int f 0/3

Switch(config-if)#switchport mode trunk                (接口设置为trunk模式)

Switch(config-if)#switchport trunk allowed vlan all        (运行所有vlan通过)

 

RT1:

 

Router>enable

Router#configure terminal

Router(config)#int fastEthernet 0/0.1      (进入子接口)

Router(config-subif)#encapsulation dot1Q 30      (封装dot1Q协议,建立与vlan30的关联)

Router(config-subif)#ip add 172.16.3.254 255.255.255.0

Router(config-subif)#int f 0/0.2

Router(config-subif)#encapsulation dot1Q 40       (封装dot1Q协议,建立与vlan40的关联)

Router(config-subif)#ip add 172.16.4.254 255.255.255.0

Router(config-subif)#int f 0/0

Router(config-if)#no shutdown             (启动f0/0的接口,包括所有子接口)

单臂路由实现不同VLAN间通讯,本来跨vlan是不能通讯的,相同VLAN才能通讯单臂路由实现不同VLAN间通讯,本来跨vlan是不能通讯的,相同VLAN才能通讯

单臂路由实现不同VLAN间通讯,本来跨vlan是不能通讯的,相同VLAN才能通讯

实现了,Vlan30能与vlan40互相通讯。