Example for Configuring One-Arm Static BFD for RIP
Networking Requirements
As shown in Figure 3-11, there are four routers that communicate using RIP on a small-sized network. Services are transmitted through the primary link Router A->Router B->Router D. Reliability must be improved for data transmitted from Router A to Router B so that services can be rapidly switched to another path for transmission when the primary link fails.
Configuration Roadmap
The configuration roadmap is as follows:
Configure IP address for each interface to ensure network reachability.
Enable RIP on each switch to implement network connections between processes.
Configure One-Arm static BFD on Router A. BFD can rapidly detect the link status and help RIP speed up route convergence to implement fast link switching.
Procedure
- Configure IP address for each interface.
# Configure Router A.
<Huawei> system-view [Huawei] sysname RouterA [RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] ip address 192.168.2.1 24 [RouterA-GigabitEthernet1/0/0] quit [RouterA] interface gigabitethernet 2/0/0 [RouterA-GigabitEthernet2/0/0] ip address 192.168.3.1 24 [RouterA-GigabitEthernet2/0/0] quit
The configurations of Router B, Router C and Router D are similar to the configuration of Router A, and are not mentioned here.
- Configure basic RIP functions.
# Configure Router A.
[RouterA] rip 1 [RouterA-rip-1] version 2 [RouterA-rip-1] network 192.168.2.0 [RouterA-rip-1] network 192.168.3.0 [RouterA-rip-1] quit
# Configure Router B.
[RouterB] rip 1 [RouterB-rip-1] version 2 [RouterB-rip-1] network 192.168.2.0 [RouterB-rip-1] network 192.168.4.0 [RouterB-rip-1] network 172.16.0.0 [RouterB-rip-1] quit
# Configure Router C.
[RouterC] rip 1 [RouterC-rip-1] version 2 [RouterC-rip-1] network 192.168.3.0 [RouterC-rip-1] network 192.168.4.0 [RouterC-rip-1] quit
# Configure Router D.
[RouterD] rip 1 [RouterD-rip-1] version 2 [RouterD-rip-1] network 172.16.0.0 [RouterD-rip-1] quit
# After the configurations are complete, run the display rip neighbor command, and you can see that RIP neighbor relationships among Router A, Router B, and Router C have been established. Take the display on Router A as an example.
[RouterA] display rip 1 neighbor
--------------------------------------------------------------------- IP Address Interface Type Last-Heard-Time --------------------------------------------------------------------- 192.168.2.2 GigabitEthernet1/0/0 RIP 0:0:1 Number of RIP routes : 1 192.168.3.3 GigabitEthernet2/0/0 RIP 0:0:2 Number of RIP routes : 2
# Run the display ip routing-table command, and you can see that routers have learned routes from each other. Take the display on Router A as an example.
[RouterA] display ip routing-table
Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Tables: Public Destinations : 8 Routes : 9 Destination/Mask Proto Pre Cost Flags NextHop Interface 192.168.2.0/24 Direct 0 0 D 192.168.2.1 GigabitEthernet1/0/0 192.168.2.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0 192.168.3.0/24 Direct 0 0 D 192.168.3.1 GigabitEthernet2/0/0 192.168.3.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet2/0/0 192.168.4.0/8 RIP 100 1 D 192.168.2.2 GigabitEthernet1/0/0 RIP 100 1 D 192.168.3.3 GigabitEthernet2/0/0 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 172.16.0.0/16 RIP 100 1 D 192.168.2.2 GigabitEthernet1/0/0
The routing table shows that the next-hop IP address of the route destined for 172.16.0.0/16 is 192.168.2.2, the outbound interface is GigabitEthernet 1/0/0, and traffic is transmitted along the primary link Router A ->Router B.
- Configure one-arm static BFD on Router A.
# Configure one-arm BFD on Router A.
[RouterA] bfd [RouterA-bfd] quit [RouterA] bfd 1 bind peer-ip 192.168.2.2 interface gigabitethernet 1/0/0 one-arm-echo [RouterA-session-1] discriminator local 1 [RouterA-session-1] min-echo-rx-interval 200 [RouterA-session-1] commit [RouterA-session-1] quit
# Enable static BFD on GigabitEthernet 1/0/0.
[RouterA] interface gigabitethernet 1/0/0 [RouterA-GigabitEthernet1/0/0] rip bfd static [RouterA-GigabitEthernet1/0/0] quit
# After the configurations are completed, run the display bfd session all command on Router A and you can see that a static BFD session is set up.
[RouterA] display bfd session all
[RouterA] display bfd session all ------------------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName ------------------------------------------------------------------------------------------- 1 - 192.168.2.2 Up S_IP_IF GigabitEthernet1/0/0 ------------------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
- Verify the configuration.
# Run the shutdown command on GE 1/0/0 on Router B to simulate a fault on the primary link.
Fault simulation is for configuration verification. In actual application, it is not required.
[RouterB] interface gigabitethernet 1/0/0 [RouterB-GigabitEthernet1/0/0] shutdown
# Check the routing table of Router A.
[RouterA] display ip routing-table
Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Tables: Public Destinations : 6 Routes : 6 Destination/Mask Proto Pre Cost Flags NextHop Interface 192.168.3.0/24 Direct 0 0 D 192.168.3.1 GigabitEthernet2/0/0 192.168.3.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet2/0/0 192.168.4.0/8 RIP 100 1 D 192.168.3.3 GigabitEthernet2/0/0 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 172.16.0.0/16 RIP 100 2 D 192.168.3.3 GigabitEthernet2/0/0
The routing table shows that the secondary link Router A -> Router C -> Router B starts to be used after the primary link fails. The next-hop IP address of the route destined for 172.16.0.0/16 is 192.168.3.3 and the outbound interface is GE 2/0/0.
Configuration Files
Configuration file of Router A
# sysname RouterA # bfd # interface GigabitEthernet1/0/0 ip address 192.168.2.1 255.255.255.0 rip bfd static # interface GigabitEthernet2/0/0 ip address 192.168.3.1 255.255.255.0 # rip 1 version 2 network 192.168.2.0 network 192.168.3.0 # bfd 1 bind peer-ip 192.168.2.2 interface GigabitEthernet1/0/0 one-arm-echo discriminator local 1 min-echo-rx-interval 200 commit # return
Configuration file of Router B
# sysname RouterB # bfd # interface GigabitEthernet1/0/0 ip address 192.168.2.2 255.255.255.0 # interface GigabitEthernet2/0/0 ip address 192.168.4.1 255.255.255.0 # interface GigabitEthernet3/0/0 ip address 172.16.1.1 255.255.255.0 # rip 1 version 2 network 192.168.2.0 network 192.168.4.0 network 172.16.0.0 # return
Configuration file of Router C
# sysname RouterC # interface GigabitEthernet1/0/0 ip address 192.168.4.2 255.255.255.0 # interface GigabitEthernet2/0/0 ip address 192.168.3.3 255.255.255.0 # rip 1 version 2 network 192.168.3.0 network 192.168.4.0 # return
Configuration file of Router D
# sysname RouterD # interface GigabitEthernet1/0/0 ip address 172.16.1.2 255.255.255.0 # rip 1 version 2 network 172.16.0.0 # return