VRRP实现路由备份路由分流
核心提示:VRRP(虚拟路由器冗余协议)是一种容错协议。一般来说,在一个网络中的主机设置一个默认路由,由主机发送的消息是不是在默认的网络段。VRRP(虚拟路由器冗余协议)是一种容错协议。通常,在一个网络中设置一个默认路由主机,由主机发送的消息是不是在网络段。它将通过默认路由发送到路由器路由器,以实现主机与外部网络之间的通信,当路由器路由器出现故障时,此段以路由器为默认路由的所有主机都将脱离外部通信。
VRRP提出了解决上述问题。它是专为局域网(如以太网)和多播或广播capability.vrrp组织一组路由器,包括一个主多备份,进入一个虚拟的路由器,如实验的拓扑结构,即一个备份组。
The interface monitoring function of VRRP extends the backup function.When the interface in the router is in an unavailable state, we think the state of the router is unstable and is not suitable for doing the MASTER routers in the backup group.Set the interface monitoring function, the system will be based on the dynamic state of the monitoring interface to adjust the router priority -- once the monitoring interface is not available, reducing the priority value of the router, in order to ensure the other state with a router interface backup group in more stable can be more easily converted to MASTER router.
实验拓扑图:
实验需要:
1、VLAN 10的主要途径是R2,R3的备份路径,并vlan20亦然;
2,在一些路由备份和路由分流的基础上;
3,使用R1来模拟外部网络,内部网络用户可以访问外部网络。
注:设备型号:华为r2621,S2000,
实验配置:
R2主配置:
拆下#分子接口,VLAN标签封装
{ r2-ethernet0.10 } VLAN型dot1q西元10 # VLAN标签>
{ }的IP地址r2-ethernet0.10 192.168.10.1 24
{ }间r2-ethernet0.10 e0.20 # VLAN标签
{ r2-ethernet0.20 } VLAN型dot1q VID 20
{ }的IP地址r2-ethernet0.20 192.168.20.1 24
创建表# ACL规则,配置NAT
{ r2-acl-2000 }规则允许源192.168.0.0 0.0.255.255
{ r2-acl-2000 }规则否认任何
R2
{ 2000 } NAT r2-serial0间
# VRRP的配置
{ r2-ethernet0.10 } VRRP虚拟路由器标识符10虚拟192.168.10.254 vrid10 IP #指定虚拟网关
{ 10 } VRRP虚拟路由器标识符r2-ethernet0.10优先级为120的虚拟路由器标识符10 #调整优先级120,备份组硕士
{ 10 } VRRP虚拟路由器标识符r2-ethernet0.10轨道的0减少40 #设置监控接口,当接口不可用时,路由器的优先级降低40,默认值为下降10
{ r2-ethernet0.20 } VRRP虚拟路由器标识符20虚拟192.168.20.254 vrid20 IP #指定虚拟网关
主配置:
拆下#分子接口,VLAN标签封装
{R3} e0.10间
{ r3-ethernet0.10 } VLAN典型点VID 10
{ } 192.168.10.2 r3-ethernet0.10 IP地址24
{ } e0.20间r3-ethernet0.10
{ r3-ethernet0.20 } VLAN典型点VID 20
{ } 192.168.20.2 r3-ethernet0.20 IP地址24
创建表# ACL规则,配置NAT
{ r3-acl-2000 }规则允许源192.168.0.0 0.0.255.255
{ r3-acl-2000 }规则否认任何
{R3}间S1
{ 2000 } NAT r3-serial1间
# VRRP的配置
{R3} e0.10间
{R3-Ethernet0.10}vrrp VRID 10 virtual 192.168.10.254 # designated vrid10 virtual IP
{ } e0.20间r3-ethernet0.10
{ r3-ethernet0.20 } VRRP虚拟路由器标识符20虚拟192.168.20.254
{ 20 } VRRP虚拟路由器标识符r3-ethernet0.20优先级120
{ 20 } VRRP虚拟路由器标识符r3-ethernet0.20轨道1红40
SW1主要配置:
#中继端口配置
{ sw1-ethernet1 / 0 / 1 }允许所有的vlan
{ sw1-ethernet1 / 0 / 1 / 0 }间E1 / 2
{ sw1-ethernet1 / 0 / 2 }端口连接型干
{ sw1-ethernet1 / 0 / 2 }允许所有的vlan
# VLAN的添加,并指定端口
{ 10 } VLAN SW1
{ 20 } VLAN sw1-vlan10
{ sw1-vlan20 }端口ETH 1 / 0 / 20
{ 10 } VLAN sw1-vlan20
{ sw1-vlan10 }端口ETH 1 / 0 / 10
SW2主要配置:
#中继端口配置
{ SW2 }间E1 / 0 / 1
{ sw2-ethernet1 / 0 / 1 }端口连接型干
{ sw2-ethernet1 / 0 / 1 }允许所有的vlan
{ sw2-ethernet1 / 0 / 1 / 0 }间E1 / 2
{ sw2-ethernet1 / 0 / 2 }端口连接型干
{ sw2-ethernet1 / 0 / 2 }允许所有的vlan
# VLAN的添加,并指定端口
{ sw2-ethernet1 / 0 / 2 } VLAN 10
{ sw2-vlan10 }端口以太网1 / 0 / 10
{ 20 } VLAN sw2-vlan10
{ sw2-vlan20 }端口以太网1 / 0 / 20
实验测试:
1、看R2和R3的VRRP路由备份状态;(如成立,R2是掌握vlan10,R3是vlan20大师);
R3 VRRP状态:
2、通过vlan20主机pingvlan10主机,发现转发数据包通过R3,而vlan10 Ping主机vlan20主机会发现数据包被转发到R2。
接下来,让实验环境找到一些来测试它是否作为路由备份工作。
1、现在打破SW2的E1 / 0 / 1接口,R2的所有VLAN是主人,当然,平是正常的,会有一些丢失的包在中间;
2,现在关闭R3广域网接口S1并观察路由备份组。
{R3}间S1
{ r3-serial1 }关
R3 VRRP组发现有备份,和R2的VRRP组硕士。
当R3的广域网接口S1是封闭的,对vlan20主机ping主机是迷失在中间,然后是正常的。
三.通过路由跟踪,我们可以看到它是通过R2访问外部网络:
实验测试正常,实验结束。