Huawei router, switch VRRP combined with BFD technology configuration experiment

Huawei router, switch VRRP combined with BFD technology configuration experiment

VRRP technology

Virtual Router Redundancy Protocol (VRRP) is an IP protocol suite. We know that there are ICMP and OSPF in the IP protocol suite. VRRP is also a member of the IP protocol suite, and the protocol number is 112. In VRRP, the device has two roles (Master and Backup), where the Master is responsible for running business traffic, and the Backup is responsible for backup. When the Master hangs up, Backup automatically preempts it as the Master, and then all data goes from the Master. VRRP is mainly used for redundant backup of egress links. Multiple gateway devices can join a backup group, but there can only be one master device. When the master device hangs up, other backup devices automatically preempt as the master device To ensure the reliability of the network.

BFD technology

BFD (Bidirectional forwarding detection): Bidirectional forwarding detection mechanism, used for rapid detection and monitoring the forwarding connection status of links or ip routes in the network. It is often used with various igp and bgp routes to achieve rapid convergence. By establishing a BFD session, BFD detection packets are sent every one second by default, and the timeout time is 3 times to monitor the network status in all directions.

VRRP configuration on the router

The IP address planning of the experimental topology is shown in the figure:
Insert picture description here

Claim

  1. R1 serves as the primary gateway of VLAN11 and the backup gateway of VLAN12
  2. R2 serves as the primary gateway of VLAN12 and the backup gateway of VLAN11
  3. Automatic switching can be realized when the uplink port of R3 fails

VLAN11 master and backup gateway settings

R1:
interface GigabitEthernet0/0/0
 ip address 10.10.11.3 255.255.255.0 //配置与PC1同一网段的地址
 vrrp vrid 1 virtual-ip 10.10.11.1  //设置虚拟网关
 vrrp vrid 1 priority 120  //设置优先级
 vrrp vrid 1 preempt-mode timer delay 10  //恢复后10s内抢占为master 
 vrrp vrid 1 track interface GigabitEthernet0/0/1 reduced 40  //使用VRRP的track追踪上联端口,上联端口down掉之后优先级减少40
 #
R2:
interface GigabitEthernet0/0/2   
 ip address 10.10.11.4 255.255.255.0  //配置与PC1同一网段的地址
 vrrp vrid 1 virtual-ip 10.10.11.1    //设置虚拟网关
 vrrp vrid 1 preempt-mode timer delay 3   //恢复后3s内抢占为master 
#

VLAN12 master and backup gateway settings

R2:
interface GigabitEthernet0/0/0   
ip address 10.10.12.3 255.255.255.0    //配置与PC2同一网段的地址
 vrrp vrid 2 virtual-ip 10.10.12.1     //设置虚拟网关
 vrrp vrid 2 priority 120    //设置优先级
 vrrp vrid 2 preempt-mode timer delay 3  //恢复后3s内抢占为master 
#
R1:

interface GigabitEthernet0/0/2
 ip address 10.10.12.4 255.255.255.0 //配置与PC2同一网段的地址
 vrrp vrid 2 virtual-ip 10.10.12.1   //设置虚拟网关

VRRP combined with BFD technology

R1
[R1]bfd //启用BFD
[R1]bfd 1 bind peer-ip 10.10.93.1 (R3的接口地址) //创建一个序号为1的bfd会话,并指定收发bfd的对端ip(vlan端口或直连需要写源IP)
[R1]bfd 1
   discriminator local 1 //指定本地标示为1
   discriminator remote 4  //指定对端标示为 4
   Commit  //提交bfd会话,否则会话不会生效
R3
[R3]bfd //启用BFD
[R3]bfd 1 bind peer-ip 10.100.13.1 (R1的接口地址) //创建一个序号为1的bfd会话,并指定收发bfd的对端ip(vlan端口或直连需要写源IP)
[R1]bfd 1
   discriminator local 4 //指定本地标示为1
   discriminator remote 1  //指定对端标示为 4
   Commit  //提交bfd会话,否则会话不会生效
R1:
interface GigabitEthernet0/0/0
 ip address 10.10.11.3 255.255.255.0  
 vrrp vrid 1 virtual-ip 10.10.11.1
 vrrp vrid 1 priority 120
 vrrp vrid 1 preempt-mode timer delay 10
 vrrp vrid 1 track bfd-session 1 reduced 40  //调用BFD会话1 ,如果BFD追踪的peer不可达时,优先值减去40
SW1的配置(SW2的配置类似):

interface GigabitEthernet0/0/1
 port link-type access  //设置接终端的接口为access模式
interface GigabitEthernet0/0/2
 port link-type trunk  //设置接路由器的接口为trunk模式
 port trunk allow-pass vlan 2 to 4094  //允许所有VLAN通过
interface GigabitEthernet0/0/3
 port link-type trunk   //设置接路由器的接口为trunk模式
 port trunk allow-pass vlan 2 to 4094  //允许所有VLAN通过
#

VRRP configuration on the switch

The topology and IP address planning are shown in the figure:
Insert picture description here

demand

  1. SW1 is the primary gateway of vlan11 and the backup gateway of vlan12
  2. SW2 is the opposite
  3. When the main gateway's uplink link is down, the priority is automatically reduced by 30, and then it is quickly switched to the standby gateway.
  4. When the master gateway is restored, it can be preempted as the master within 20 seconds

VLAN11 master and backup gateway configuration

SW1:
interface Vlanif11
 ip address 10.10.11.253 255.255.255.0
 vrrp vrid 1 virtual-ip 10.10.11.254  //创建vlan11虚拟网关,VRID为1(范围1-255)
 vrrp vrid 1 priority 120 //更改优先级为120
 vrrp vrid 1 preempt-mode timer delay 20 //当恢复后20秒内抢占为master
 vrrp vrid 1 track interface GigabitEthernet0/0/2 reduced 30 //跟踪上联端口,当端口异常时,	减掉优先级值30
SW2:
interface Vlanif11
 ip address 10.10.11.252 255.255.255.0
 vrrp vrid 1 virtual-ip 10.10.11.254
#

VLAN12 master and backup gateway configuration

SW2:
interface Vlanif12
 ip address 10.10.12.252 255.255.255.0
 vrrp vrid 2 virtual-ip 10.10.12.254
 vrrp vrid 2 priority 120
 vrrp vrid 2 preempt-mode timer delay 20
 vrrp vrid 2 track interface GigabitEthernet0/0/1 reduced 30
#
SW1:
#
interface Vlanif12
 ip address 10.10.12.253 255.255.255.0
 vrrp vrid 2 virtual-ip 10.10.12.254  

Guess you like

Origin blog.csdn.net/m0_46674735/article/details/108346189