Study Fanl - 一广泛的知识学习聚集地

单臂路由基本原理与配置

一、VLAN间路由

即:使用路由器(物理接口或子接口)实现VLAN间通信

1、双臂路由



弊端:使用物理接口,每个VLAN对应一个物理接口,成本大链路多,只能做双臂路由


2、单臂路由



使用子接口:实现单臂路由,有多少个vlan就可以创建多少个子接口,单接口最多4096个子接口
子接口:只占一个物理接口(但可能导致单点故障

 

二、路由器实现单臂路由(实验一):

也可将他们划分在同一网段,在子接口上配置同一网段接口作为gw地址即可


1、SW1上配置:

[Huawei]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type access 
[Huawei-Ethernet0/0/1]port default vlan 10
[Huawei-Ethernet0/0/1]int e0/0/3
[Huawei-Ethernet0/0/3]p l a
[Huawei-Ethernet0/0/3]p d v 20
[Huawei-Ethernet0/0/3]int e0/0/2
[Huawei-Ethernet0/0/2]p l t
[Huawei-Ethernet0/0/2]p t a v 10 20
//正常情况下配置在不同vlan且隔离了无法实现互通需要走三层

2、R1上配置:

<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]int e0/0/1.10
[Huawei-Ethernet0/0/1.10]dot1q termination vid 10
[Huawei-Ethernet0/0/1.10]ip address 192.168.0.254 24
[Huawei-Ethernet0/0/1.10]arp broadcast enable 
[Huawei-Ethernet0/0/1.10]int e0/0/1.20
[Huawei-Ethernet0/0/1.20]dot1q termination vid 20
[Huawei-Ethernet0/0/1.20]ip address 192.168.1.254 24
[Huawei-Ethernet0/0/1.20]arp broadcast enable 
//开启ARP广播若收到数据为ARP地址可以进行响应

3、实验验证:

  1. ping测试:PC1 ping PC2



  2. tarcert测试:PC1到PC2走的网关192.168.0.254


三、交换机VLANIF接口实现vlan间通信(实验二):

注:三层交换机的vlanif接口可以配置IP地址

工作原理:带VLAN的数据帧到VLANIF接口后,将会将原来vlan去掉,根据IP地址转发,到目的路由模块后发送到物理口后打上VLAN标签,vlan绑定的哪个接口,那个接口为绑定MAC

1、三层交换机VLANIF实现单臂路由Lab

R1替换为三层交换机,如图:

2、SW1上与上面路由器实验一致配置不变

3、SW2上:

<Huawei>sy
[Huawei]un in en
[Huawei]vlan batch 10 20
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]p l t
[Huawei-GigabitEthernet0/0/1]p t a v 10 20
//quit返回
[Huawei]int vlanif 10
[Huawei-Vlanif10]ip add 192.168.0.254 24
[Huawei-Vlanif10]int vlanif 20
[Huawei-Vlanif20]ip add 192.168.1.254 24

4、结果验证:

ping+tracert:

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »