Example for Associating a VRRP Group with a BFD Session
In this example, a VRRP group is associated with a BFD session. If the interface on which the VRRP status is Master or the link monitored by BFD goes Down, a backup device in the VRRP group preempts the Master state and takes over.
Networking Requirements
To improve link reliability, a user gateway is dual-homed to an upper-layer network and VRRP is configured to determine the active/standby status of dual-homing links and perform active/standby link switchovers if a fault occurs on the active link.
If a link fails, an active/standby link switchover is performed after link states are negotiated by sending VRRP Advertisement packets. To speed up link switchovers, enable BFD to monitor links and associate VRRP with BFD. If an interface or a link fails on the master device in the VRRP group, BFD rapidly detects the fault and notifies the VRRP group of the fault. After receiving the notification, the VRRP group performs a master/backup VRRP switchover. The backup device enters the Master state.
On the network shown in Figure 4-18, Device A, Device B, Device C, Device D, and a universal media gateway (UMG) form a simple next generation network (NGN) functioning as a bearer network.
The UMG is dual-homed to Device A and Device B through Device C and Device D, respectively.
A VRRP group is configured on Device A and Device B. Device A is the master device, and Device B is the backup device.
Interface 1 in this example represents GE 0/1/0.
Precautions
The IP address of GE 0/1/0 on Device A and IP address of GE 0/1/0 on Device B must be on the same network segment.
Configuration Roadmap
The configuration roadmap is as follows:
Configure a BFD session on Device A and Device B to monitor Device A, Device B, the link from Device A to Device C, and the link from Device B to Device D.
Configure a VRRP group on GE 0/1/0 of Device A and GE 0/1/0 of Device B. Device A is the master device, and Device B is the backup device.
Associate the VRRP group on Device B (backup) with the BFD session. If the BFD session goes Down, the VRRP group immediately performs a master/backup switchover.
Data Preparation
To complete the configuration, you need the following data:
Local and remote discriminators of BFD sessions
Virtual IP address and ID of a VRRP group
Priority of each device in a VRRP group
Procedure
- Configure a BFD session.
# Configure Device A.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] bfd
[~DeviceA-bfd] quit
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] ip address 10.1.1.1 24
[*DeviceA-GigabitEthernet0/1/0] quit
[*DeviceA] bfd trackbfd bind peer-ip 10.1.1.2 interface gigabitethernet 0/1/0
[*DeviceA-bfd-session-trackbfd] discriminator local 1
[*DeviceA-bfd-session-trackbfd] discriminator remote 2
[*DeviceA-bfd-session-trackbfd] commit
[~DeviceA-bfd-session-trackbfd] quit
# Configure Device B.
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] bfd
[~DeviceB-bfd] quit
[~DeviceB] interface gigabitethernet 0/1/0
[~DeviceB-GigabitEthernet0/1/0] ip address 10.1.1.2 24
[*DeviceB-GigabitEthernet0/1/0] quit
[*DeviceB] bfd trackbfd bind peer-ip 10.1.1.1 interface gigabitethernet 0/1/0
[*DeviceB-bfd-session-trackbfd] discriminator local 2
[*DeviceB-bfd-session-trackbfd] discriminator remote 1
[*DeviceB-bfd-session-trackbfd] commit
[~DeviceB-bfd-session-trackbfd] quit
After completing the configurations, run the display bfd session all command on Device A or Device B. The command output shows that a BFD session has been established and its status is Up. The following example uses the command output on Device A.
[~DeviceA] display bfd session all
(w): State in WTR (*): State is invalid ------------------------------------------------------------------------------ Local Remote PeerIpAddr State Type InterfaceName ------------------------------------------------------------------------------ 1 2 10.1.1.2 Up S_IP_IF GigabitEthernet0/1/0 ------------------------------------------------------------------------------ Total UP/DOWN Session Number : 1/0
- Configure VRRP group 1.
# Configure VRRP group 1 on Device A, and set the VRRP priority of Device A to 120 so that Device A functions as the master device.
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] vrrp vrid 1 virtual-ip 10.1.1.111
[*DeviceA-GigabitEthernet0/1/0] vrrp vrid 1 priority 120
[*DeviceA-GigabitEthernet0/1/0] commit
[~DeviceA-GigabitEthernet0/1/0] quit
# Configure VRRP group 1 on Device B, and retain the default VRRP priority for Device B so that Device B functions as the backup device.
[~DeviceB] interface gigabitethernet 0/1/0
[~DeviceB-GigabitEthernet0/1/0] vrrp vrid 1 virtual-ip 10.1.1.111
[*DeviceB-GigabitEthernet0/1/0] commit
[~DeviceB-GigabitEthernet0/1/0] quit
After completing the configurations, run the display vrrp command on Device A and Device B. The command outputs show that the VRRP status of Device A is Master and that the VRRP status of Device B is Backup.
[~DeviceA] display vrrp
GigabitEthernet0/1/0 | Virtual Router 1 State : Master Virtual IP : 10.1.1.111 Master IP : 10.1.1.1 Local IP : 10.1.1.1 PriorityRun : 120 PriorityConfig : 120 MasterPriority : 120 Preempt : YES Delay Time : 0s Hold Multiplier : 4 TimerRun : 1s TimerConfig : 1s Auth Type : NONE Virtual MAC : 00e0-fc12-7890 Check TTL : YES Config Type : normal-vrrp Backup-forward : disabled Create Time : 2011-12-29 05:41:23 Last Change Time : 2011-12-29 05:41:33
[~DeviceB] display vrrp
GigabitEthernet0/1/0 | Virtual Router 1 State : Backup Virtual IP : 10.1.1.111 Master IP : 10.1.1.1 Local IP : 10.1.1.2 PriorityRun : 100 PriorityConfig : 100 MasterPriority : 120 Preempt : YES Delay Time : 0s Hold Multiplier : 4 TimerRun : 1s TimerConfig : 1s Auth Type : NONE Virtual MAC : 00e0-fc12-7890 Check TTL : YES Config Type : normal-vrrp Backup-forward : disabled Create Time : 2011-12-29 05:41:23 Last Change Time : 2011-12-29 05:41:33
- Associate the VRRP group with the BFD session on Device B.
[~DeviceB] interface gigabitethernet 0/1/0
[~DeviceB-GigabitEthernet0/1/0] vrrp vrid 1 track bfd-session 2 increased 40
[*DeviceB-GigabitEthernet0/1/0] commit
[~DeviceB-GigabitEthernet0/1/0] quit
After completing the configurations, run the display vrrp command on Device B to view the associated BFD session and its status.
[~DeviceB] display vrrp
GigabitEthernet0/1/0 | Virtual Router 1 State : Backup Virtual IP : 10.1.1.111 Master IP : 10.1.1.1 Local IP : 10.1.1.2 PriorityRun : 100 PriorityConfig : 100 MasterPriority : 120 Preempt : YES Delay Time : 0s Hold Multiplier : 4 TimerRun : 1s TimerConfig : 1s Auth Type : NONE Virtual MAC : 00e0-fc12-7890 Check TTL : YES Config Type : normal-vrrp Backup-forward : disabled Track BFD : 2 Priority Increased : 40 BFD-Session State : UP Create Time : 2011-12-29 05:41:23 Last Change Time : 2011-12-29 05:41:33
- Verify the configuration.
Run the shutdown command on GE 0/1/0 of Device A to simulate a link fault.
[*DeviceA] interface gigabitethernet 0/1/0
[*DeviceA-GigabitEthernet0/1/0] shutdown
[*DeviceA-GigabitEthernet0/1/0] commit
[*DeviceA-GigabitEthernet0/1/0] quit
Run the display vrrp command on Device A. The command output shows that the VRRP status of Device A has become Initialize.
[~DeviceA] display vrrp
GigabitEthernet0/1/0 | Virtual Router 1 State : Initialize Virtual IP : 10.1.1.111 Master IP : 0.0.0.0 Local IP : 10.1.1.1 PriorityRun : 0 PriorityConfig : 120 MasterPriority : 0 Preempt : YES Delay Time : 0s Hold Multiplier : 4 TimerRun : 1s TimerConfig : 1s Auth Type : NONE Virtual MAC : 00e0-fc12-7890 Check TTL : YES Config Type : normal-vrrp Backup-forward : disabled Create Time : 2011-12-29 05:41:23 Last Change Time : 2011-12-29 05:41:33
Run the display vrrp command on Device B. The command output shows that the VRRP status of Device B has become Master.
[~DeviceB] display vrrp
GigabitEthernet0/1/0 | Virtual Router 1 State : Master Virtual IP : 10.1.1.111 Master IP : 10.1.1.2 Local IP : 10.1.1.2 PriorityRun : 140 PriorityConfig : 100 MasterPriority : 140 Preempt : YES Delay Time : 0s Hold Multiplier : 4 TimerRun : 1s TimerConfig : 1s Auth Type : NONE Virtual MAC : 00e0-fc12-7890 Check TTL : YES Config Type : normal-vrrp Backup-forward : disabled Track BFD : 2 Priority Increased :40 BFD-Session State : DOWN Create Time : 2011-12-29 05:41:23 Last Change Time : 2011-12-29 05:41:33
Configuration Files
Device A configuration file
# sysname DeviceA # bfd # interface GigabitEthernet0/1/0 undo shutdown ip address 10.1.1.1 255.255.255.0 vrrp vrid 1 virtual-ip 10.1.1.111 vrrp vrid 1 priority 120 # bfd trackbfd bind peer-ip 10.1.1.2 interface GigabitEthernet0/1/0 discriminator local 1 discriminator remote 2 return
Device B configuration file
# sysname DeviceB # bfd # interface GigabitEthernet0/1/0 undo shutdown ip address 10.1.1.2 255.255.255.0 vrrp vrid 1 virtual-ip 10.1.1.111 vrrp vrid 1 track bfd-session 2 increased 40 # bfd trackbfd bind peer-ip 10.1.1.1 interface GigabitEthernet0/1/0 discriminator local 2 discriminator remote 1 return