Configuring BFD for RIP (bidirectional control detection mode)
Network requirements
In the following figure, Switch A is connected to Switch C through Switch B. VLAN-interface 100 on Switch A, VLAN-interface 200 on Switch C, and VLAN-interface 200 and VLAN-interface 100 on Switch B run RIP process 1.
Configure a static route to Switch C on Switch A, and configure a static route to Switch A on Switch C. Enable BFD on VLAN-interface 100 of Switch A and VLAN-interface 200 of Switch C.
Switch A is connected to Switch C through Switch D. VLAN-interface 300 on Switch A runs RIP process 2; VLAN-interface 400 on Switch C, and VLAN-interface 300 and VLAN-interface 400 on Switch D run RIP process 1.
Enable static route redistribution into RIP on Switch A and Switch C so that Switch A and Switch C have routes to send to each other. Switch A learns the static route sent by Switch C, the output interface is the interface connected to Switch B.
Configure BFD so that when the link between Switch B and Switch C fails, BFD can quickly detect the link failure and notify it to RIP, and the BFD session goes down. In response, RIP deletes the neighbor relationship with Switch C and the route information received from Switch C. Then, Switch A learns the static route sent by Switch C, the output interface of the route is the interface connected to Switch D.
Figure 16: Network diagram
Configuration procedure
Configure IP addresses for interfaces. (Details not shown.)
Configure RIP basic functions and enable static route redistribution into RIP so that Switch A and Switch C have routes to send to each other:
# Configure Switch A.
<SwitchA> system-view [SwitchA] rip 1 [SwitchA-rip-1] version 2 [SwitchA-rip-1] undo summary [SwitchA-rip-1] network 192.168.1.0 [SwitchA-rip-1] peer 192.168.2.2 [SwitchA-rip-1] undo validate-source-address [SwitchA-rip-1] import-route static [SwitchA-rip-1] quit [SwitchA] interface vlan-interface 100 [SwitchA-Vlan-interface100] rip bfd enable [SwitchA-Vlan-interface100] quit [SwitchA] rip 2 [SwitchA-rip-2] version 2 [SwitchA-rip-2] undo summary [SwitchA-rip-2] network 192.168.3.0 [SwitchA-rip-2] quit
# Configure Switch C.
<SwitchC> system-view [SwitchC] rip 1 [SwitchC-rip-1] version 2 [SwitchC-rip-1] undo summary [SwitchC-rip-1] network 192.168.2.0 [SwitchC-rip-1] network 192.168.4.0 [SwitchC-rip-1] peer 192.168.1.1 [SwitchC-rip-1] undo validate-source-address [SwitchC-rip-1] import-route static [SwitchC-rip-1] quit [SwitchC] interface vlan-interface 200 [SwitchC-Vlan-interface200] rip bfd enable [SwitchC-Vlan-interface200] quit
# Configure Switch D.
<SwitchD> system-view [SwitchD] rip 1 [SwitchD-rip-1] version 2 [SwitchD-rip-1] undo summary [SwitchD-rip-1] network 192.168.3.0 [SwitchD-rip-1] network 192.168.4.0
Configure BFD parameters:
# Configure Switch A.
[SwitchA] bfd session init-mode active [SwitchA] interface vlan-interface 100 [SwitchA-Vlan-interface100] bfd min-transmit-interval 500 [SwitchA-Vlan-interface100] bfd min-receive-interval 500 [SwitchA-Vlan-interface100] bfd detect-multiplier 7 [SwitchA-Vlan-interface100] quit
# Configure Switch C.
[SwitchC] bfd session init-mode active [SwitchC] interface vlan-interface 200 [SwitchC-Vlan-interface200] bfd min-transmit-interval 500 [SwitchC-Vlan-interface200] bfd min-receive-interval 500 [SwitchC-Vlan-interface200] bfd detect-multiplier 7 [SwitchC-Vlan-interface200] quit
Configure static routes.
# Configure a static route to Switch C on Switch A.
[SwitchA] ip route-static 192.168.2.0 24 vlan-interface 100 192.168.1.2 [SwitchA] ip route-static 101.1.1.0 24 null 0 [SwitchA] quit
# Configure a static route to Switch A on Switch C.
[SwitchC] ip route-static 192.168.1.0 24 vlan-interface 200 192.168.2.1 [SwitchC] ip route-static 100.1.1.0 24 null 0
IMPORTANT:
If you specify null 0 interface as the output interface for a static route, do not specify the IP address of a directly connected network as the destination IP address.
Verify the configuration:
# Display the BFD session information on Switch A.
<SwitchA> display bfd session Total Session Num: 1 Init Mode: Active Session Working Under Ctrl Mode: LD/RD SourceAddr DestAddr State Holdtime Interface 6/3 192.168.1.1 192.168.2.2 Up 1700ms vlan100
# Display routes destined for 100.1.1.0/24 on Switch A.
<SwitchA> display ip routing-table 100.1.1.0 24 verbose Routing Table : Public Summary Count : 2 Destination: 100.1.1.0/24 Protocol: RIP Process ID: 1 Preference: 100 Cost: 1 IpPrecedence: QosLcId: NextHop: 192.168.2.2 Interface: vlan-interface 100 BkNextHop: 0.0.0.0 BkInterface: RelyNextHop: 192.168.1.2 Neighbor: 192.168.2.2 Tunnel ID: 0x0 Label: NULL BKTunnel ID: 0x0 BKLabel: NULL State: Active GotQ Age: 00h00m47s Tag: 0 Destination: 100.1.1.0/24 Protocol: RIP Process ID: 2 Preference: 100 Cost: 2 IpPrecedence: QosLcId: NextHop: 192.168.3.2 Interface: vlan-interface 300 BkNextHop: 0.0.0.0 BkInterface: RelyNextHop: 0.0.0.0 Neighbor : 192.168.3.2 Tunnel ID: 0x0 Label: NULL BKTunnel ID: 0x0 BKLabel: NULL State: Inactive Adv Age: 00h12m50s Tag: 0
When the link over VLAN-interface 100 fails, Switch A quickly detects the link state change.
# Display the BFD information on Switch A.
<SwitchA> display bfd session
Switch A has deleted the BFD session on VLAN-interface 100 to Switch C and displays no output.
# Display the RIP routes of RIP process 1 on Switch A.
<SwitchA> display rip 1 route Route Flags: R - RIP, T - TRIP P - Permanent, A - Aging, S - Suppressed, G - Garbage-collect ----------------------------------------------------------------------------
The output show that the RIP route learned from Switch C no longer exists.
# Display routes destined for 100.1.1.0/24 on Switch A.
<SwitchA> display ip routing-table 100.1.1.0 24 verbose Routing Table : Public Summary Count : 1 Destination: 100.1.1.0/24 Protocol: RIP Process ID: 2 Preference: 100 Cost: 2 IpPrecedence: QosLcId: NextHop: 192.168.3.2 Interface: vlan-interface 300 BkNextHop: 0.0.0.0 BkInterface: RelyNextHop: 0.0.0.0 Neighbor : 192.168.3.2 Tunnel ID: 0x0 Label: NULL BKTunnel ID: 0x0 BKLabel: NULL State: Active Adv Age: 00h18m40s Tag: 0