Example for Configuring Dynamic BFD for RIP
Networking Requirements
As shown in Figure 3-11, there are four switches that communicate using RIP on a small-sized network. Services are transmitted through the primary link Switch A→Switch B→Switch D. Reliability must be improved for data transmitted from Switch A to Switch 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 a VLAN and an IP address for each interface to ensure network reachability.
Enable RIP on each switch to implement network connections between processes.
Configure BFD for RIP on interfaces at both ends of the link between Switch A and Switch B. BFD can rapidly detect the link status and help RIP speed up route convergence to implement fast link switching.
Procedure
- Configure a VLAN for each interface.
<HUAWEI> system-view [~HUAWEI] sysname SwitchA [*HUAWEI] commit [~SwitchA] vlan batch 10 20 [*SwitchA] interface 10GE 1/0/1 [*SwitchA-10GE1/0/1] port link-type trunk [*SwitchA-10GE1/0/1] port trunk allow-pass vlan 10 [*SwitchA-10GE1/0/1] quit [*SwitchA] interface 10GE 1/0/2 [*SwitchA-10GE1/0/2] port link-type trunk [*SwitchA-10GE1/0/2] port trunk allow-pass vlan 20 [*SwitchA-10GE1/0/2] quit [*SwitchA] commit
The configurations of Switch B, Switch C and Switch D are similar to the configuration of Switch A, and are not provided here.
- Configure IP address for each VLANIF interface.
[~SwitchA] interface vlanif 10 [*SwitchA-Vlanif10] ip address 192.168.2.1 24 [*SwitchA-Vlanif10] quit [*SwitchA] interface vlanif 20 [*SwitchA-Vlanif20] ip address 192.168.3.1 24 [*SwitchA-Vlanif20] quit [*SwitchA] commit
The configurations of Switch B, Switch C and Switch D are similar to the configuration of Switch A, and are not provided here.
- Configure basic RIP functions.
# Configure Switch A.
<SwitchA> system-view
[~SwitchA] rip 1
[*SwitchA-rip-1] version 2
[*SwitchA-rip-1] network 192.168.4.0
[*SwitchA-rip-1] network 192.168.3.0
[*SwitchA-rip-1] quit
[*SwitchA] commit
# Configure Switch B.
<SwitchB> system-view
[~SwitchB] rip 1
[*SwitchB-rip-1] version 2
[*SwitchB-rip-1] network 192.168.4.0
[*SwitchB-rip-1] network 192.168.4.0
[*SwitchB-rip-1] network 172.16.0.0
[*SwitchB-rip-1] quit
[*SwitchB] commit
# Configure Switch C.
<SwitchC> system-view
[~SwitchC] rip 1
[*SwitchC-rip-1] version 2
[*SwitchC-rip-1] network 192.168.3.0
[*SwitchC-rip-1] network 192.168.4.0
[*SwitchC-rip-1] quit
[*SwitchC] commit
# Configure Switch D.
<SwitchD> system-view
[~SwitchD] rip 1
[*SwitchD-rip-1] version 2
[*SwitchD-rip-1] network 172.16.0.0
[*SwitchD-rip-1] quit
[*SwitchD] commit
# After completing the preceding operations, run the display rip neighbor command. The command output shows that Switch A, Switch B, and Switch C have established neighbor relationships with each other. In the following example, the display on Switch A is used.
[~SwitchA] display rip 1 neighbor
--------------------------------------------------------------------- IP Address Interface Type Last-Heard Routes --------------------------------------------------------------------- 192.168.2.2 Vlanif10 RIP 0:0:14 2 192.168.3.2 Vlanif20 RIP 0:0:19 1
# Run the display ip routing-table command. The command output shows that the switches have imported routes from each other. In the following example, the display on Switch A is used.
[~SwitchA] display ip routing-table
Proto: Protocol Pre: Preference Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ Routing Table: _public_ Destinations : 12 Routes : 13 Destination/Mask Proto Pre Cost Flags NextHop Interface 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 127.0.0.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 172.16.1.0/24 RIP 100 1 D 192.168.2.2 Vlanif10 192.168.2.0/24 Direct 0 0 D 192.168.2.1 Vlanif10 192.168.2.1/32 Direct 0 0 D 127.0.0.1 Vlanif10 192.168.2.255/32 Direct 0 0 D 127.0.0.1 Vlanif10 192.168.3.0/24 Direct 0 0 D 192.168.3.1 Vlanif20 192.168.3.1/32 Direct 0 0 D 127.0.0.1 Vlanif20 192.168.3.255/32 Direct 0 0 D 127.0.0.1 Vlanif20 192.168.4.0/24 RIP 100 1 D 192.168.3.2 Vlanif20 RIP 100 1 D 192.168.2.2 Vlanif10 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
The preceding command output shows that the next-hop address and outbound interface of the route to destination 172.16.1.0/16 are 192.168.2.2 and VLANIF10 respectively, and traffic is transmitted over the active link Switch A->Switch B.
- Configure BFD in RIP processes.
# Configure BFD on all interfaces of Switch A.
[~SwitchA] bfd
[*SwitchA-bfd] quit
[*SwitchA] rip 1
[*SwitchA-rip-1] bfd all-interfaces enable
[*SwitchA-rip-1] bfd all-interfaces min-rx-interval 300 min-tx-interval 300 detect-multiplier 5
[*SwitchA-rip-1] quit
[*SwitchA] commit
The configuration of Switch B is similar to that of Switch A, and is not provided here.
# After completing the preceding operations, run the display rip bfd session command on Switch A. The command output shows that Switch A and Switch B have established a BFD session and the BFDState field value is displayed as Up. In the following example, the display on Switch A is used.
[~SwitchA] display rip 1 bfd session all
Interface :Vlanif10 LocalIp :192.168.2.1 RemoteIp :192.168.2.2 BFDState :Up Interface :Vlanif20 LocalIp :192.168.3.1 RemoteIp :192.168.3.2 BFDState :Down
- Verify the configuration.
# Run the shutdown command on 10GE1/0/0 of Switch B to simulate a fault in the active link.
The link fault is simulated to verify the configuration. In actual situations, the operation is not required.
[~SwitchB] interface 10GE 1/0/1
[~SwitchB-10GE1/0/1] shutdown
[*SwitchB-10GE1/0/1] commit
# Check the routing table of Switch A.
[~SwitchA] display ip routing-table
Proto: Protocol Pre: Preference Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ Routing Table: _public_ Destinations : 9 Routes : 9 Destination/Mask Proto Pre Cost Flags NextHop Interface 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 127.0.0.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 172.16.1.0/24 RIP 100 2 D 192.168.3.2 Vlanif20 192.168.3.0/24 Direct 0 0 D 192.168.3.1 Vlanif20 192.168.3.1/32 Direct 0 0 D 127.0.0.1 Vlanif20 192.168.3.255/32 Direct 0 0 D 127.0.0.1 Vlanif20 192.168.4.0/24 RIP 100 1 D 192.168.3.2 Vlanif20 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
The preceding command output shows that the standby link Switch A->Switch C->Switch B is used after the active link fails, and the next-hop address and outbound interface of the route to destination 172.16.1.0/16 are 192.168.3.2 and VLANIF20 respectively.
Configuration Files
Configuration file of Switch A
#
sysname SwitchA
#
vlan batch 10 20
#
bfd
#
interface Vlanif10
ip address 192.168.2.1 255.255.255.0
#
interface Vlanif20
ip address 192.168.3.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
rip 1
version 2
network 192.168.4.0
network 192.168.3.0
bfd all-interfaces enable
bfd all-interfaces min-tx-interval 300 min-rx-interval 300 detect-multiplier 5
#
return
Configuration file of Switch B
#
sysname SwitchB
#
vlan batch 10 30 40
#
bfd
#
interface Vlanif10
ip address 192.168.2.2 255.255.255.0
#
interface Vlanif30
ip address 192.168.4.1 255.255.255.0
#
interface Vlanif40
ip address 172.16.1.1 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 10
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 30
#
interface 10GE1/0/3
port link-type trunk
port trunk allow-pass vlan 40
#
rip 1
version 2
network 192.168.4.0
network 192.168.4.0
network 172.16.0.0
bfd all-interfaces enable
bfd all-interfaces min-tx-interval 300 min-rx-interval 300 detect-multiplier 5
#
return
Configuration file of Switch C
#
sysname SwitchC
#
vlan batch 20 30
#
interface Vlanif20
ip address 192.168.3.2 255.255.255.0
#
interface Vlanif30
ip address 192.168.4.2 255.255.255.0
#
interface 10GE1/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 30
#
rip 1
version 2
network 192.168.3.0
network 192.168.4.0
#
return
Configuration file of Switch D
#
sysname SwitchD
#
vlan batch 40
#
interface Vlanif40
ip address 172.16.1.2 255.255.255.0
#
interface 10GE1/0/1
port link-type trunk
port trunk allow-pass vlan 40
#
rip 1
version 2
network 172.16.0.0
#
return