Forgot password?
 Register now

Welcome to use this form to feedback your problems with Ruijie Community

The category of your feedback

Your Feedback

Your Email address (optional):

How to configure BFD on Ruijie Switch? Reply

GTAC-Sophia

Level 5

Ruijie Staff

How to configure BFD on Ruijie Switch?
1819 0 2023-5-15 10:36:07
Original
Introduction of BFD

The Bidirectional Forwarding Detection (BFD) enables a network device to rapidly detect a failure occurring in the communication with a neighbor device and switch traffic to a backup link to accelerate network convergence, thereby ensuring service continuity, reducing impact of device failures or linkfailures on services, and improving network availability. BFD packets are classified into control packets and echo packets.
Applied scenarios

The BFD protocol itself does not play a particularly meaningful role. It needs to be used in conjunction with other protocols in order to be of greater use, such as linkage with static routing, OSPF routing, VRRP protocols, policy routing, etc., using the link detection function of the BFD to sense the failure of a link of interest or an intermediate node device in the network, causing the BFD Neighbour to go down and thus notify the corresponding linkage function, such as static routing, OSPF routing, VRRP protocol, policy routing, etc. for routing policy, or switchover of primary and secondary relationships, relying on the BFD messaging mechanism to achieve ms-level switching in case of failure.
Static routing and BFD linkage example
Case of Configuration
a) Requirement

SW1, as a financial network aggregation switch, accesses two MSTP links, using floating static routes, with ISP-B as the primary link and switching to the ISP-A link in case ISP-B is not available. There is no detection mechanism for the Ethernet link, as long as the interface is UP, the line is considered available. So it is necessary to use the BFD protocol, as a link detection protocol.
b) Network Topology

c) Configuration

Configuration on SW1:
1) Configure IP addresses and floating static routes

SW1>en

SW1#conf terminal

SW1(config)#interface gigabitEthernet 0/1

SW1(config-GigabitEthernet 0/1)#no switchport

SW1(config-GigabitEthernet 0/1)#ip address 1.1.1.2255.255.255.0

SW1(config)#interface gigabitEthernet 0/2

SW1(config-GigabitEthernet 0/2)#no switchport

SW1(config-GigabitEthernet 0/2)#ip address 2.2.2.2255.255.255.0

SW1(config)#ip route 0.0.0.0 0.0.0.0  g0/1 1.1.1.1          ------>Configure the defaultroute, to link with the BFD, the route must be configured with the outgoinginterface and the next hop, the next hop and the source address specified bythe BFD on the other side must be the same

SW1(config)#ip route 0.0.0.0 0.0.0.0  2.2.2.1 200 ------>Floating route



2) Configure BFD to link with static router


SW1(config)#interface gigabitEthernet 0/1

SW1(config-GigabitEthernet 0/1)#bfd interval 500min_rx 500 multiplier 3
------>Configure the BFD time parameter, this command also enablesthe BFD function of the interface, so it must be configured; 500/500/3 is therecommended configuration here, a probe message is sent at 500ms interval,three consecutive responses are not received to declare the link failure.

SW1(config-GigabitEthernet 0/1)#no bfd echo
    ------>The default is bfd echo mode, atsome times (such as when connecting to FW or docking devices of other brands)the echo messages may be filtered resulting in BFD not being establishedsuccessfully, it is recommended to turn it off. When docking with other brands'devices, some devices do not support echo mode by default. If it is turned onour end, session down may occur.   
SW1(config)#ip route static bfd GigabitEthernet 0/11.1.1.1 source 1.1.1.2
        ------> BFD and static route linkage

Configurationon SW2:
1) Configure IP addresses and floating static routes

SW2>en

SW2#conf terminal

SW2(config)#interface gigabitEthernet 0/1

SW2(config-GigabitEthernet 0/1)#ip address 1.1.1.1255.255.255.0

SW2(config)#interface gigabitEthernet 0/2

SW2(config-GigabitEthernet 0/2)#ip address 2.2.2.1255.255.255.0

SW2(config)#ip route 192.168.1.0 255.255.255.0  1.1.1.2

SW2(config)#ip route 192.168.1.0 255.255.255.02.2.2.2 200



2) Configure BFD to link with static routes

SW2(config)#interface gigabitEthernet 0/1

SW2(config-GigabitEthernet 0/1)#bfd interval 500min_rx 500 multiplier 3     

SW2(config-GigabitEthernet 0/1)#no bfd echo

SW2(config)#ip route static bfd GigabitEthernet 0/11.1.1.2 source 1.1.1.1  



Verification
1) Run the "show bfd neighbors" toconfirm the status of BFD neighbor
R1#sh bfd nei
OurAddr           NeighAddr           LD/RDRH/RS    Holdown(mult)  State Int               
1.1.1.2                  1.1.1.1                      2/1  Up            0(5   )  Up    GigabitEthernet 0/1
2) View the routing table by "show iproute"
3) With the correct configuration and link, tracertthe intranet address of the aggregation end on the SW1 to confirm that the pathgoes to ISP-A
4) SHUTDOWN the G0/1 interface on SW2 to simulate anoperator ISP-A failure; then tracert the intranet address of the aggregationend on SW1 to confirm the path switch to SW2.
OSPFrouting and BFD linkage example
Caseof Configuration
a) Requirement

The Layer 3 switches SWA and SWB are interconnected via the Layer 2 switch, running the OSPF protocol on the devices to establish routes and allowing OSPF to associate BFD applications on both interfaces. In the event of a link failure between the SWB and the Layer 2 switch, the BFD can quickly detect and inform the OSPF protocol, triggering rapid convergence of the protocol.
b) Network Topology



c) Configuration

Configuration on SWA
1) Configure IP address and OSPF route

SWA>en

SWA#config ter

SWA(config)#interface gigabitEthernet 2/1

SWA(config-GigabitEthernet 2/1)#ip address192.168.3.1 255.255.255.0

SWA(config)#interface gigabitEthernet 1/1

SWA(config-GigabitEthernet 1/1)#ip address192.168.1.1 255.255.255.0

SWA(config-router)#router ospf 123

SWA(config-router)#network 192.168.3.0 0.0.0.255area 0

SWA(config-router)#network 192.168.1.0 0.0.0.255area 0     



2) Configure OSPF and BFD linkage
SWA(config)#interface gigabitEthernet 2/1

SWA(config-GigabitEthernet 2/1)#bfd interval 500min_rx 500 multiplier 3
------>Configure the BFD time parameter. This command also enablesthe BFD function of the interface, so it must be configured; 500/500/3 is therecommended configuration here, sending a probe message at 500ms interval, anddeclaring the link failure if no response is received 3 consecutive times. Itis recommended to configure the same parameters at both ends of the BFD sessionto ensure that the associated BFD application protocols take effect at the sametime and to avoid a single-pass forwarding path due to the differentsuppression times configured at both ends.
SWA(config-GigabitEthernet 2/1)#no bfd echo   
------>The default is bfd echo mode,at some times (such as there is a FW in the middle or docking devices of otherbrands) may filter the echo messages resulting in the BFD not being establishedsuccessfully, it is recommended to disable it. When docking with devices ofother brands, some of the devices do not support echo mode by default. If it isturned on at our end, session down may occur.
SWA(config-router)#router ospf 123      

SWA(config-router)#bfd all-interfaces
        ------>Enable ospf and BFD linkage
Configurationon SWB
1) Configure IP address and OSPF route

SWB(config)#interface gigabitEthernet 2/1

SWB(config-GigabitEthernet 2/1)#ip address192.168.3.2 255.255.255.0

SWB(config)#interface gigabitEthernet 1/1

SWB(config-GigabitEthernet 1/1)#ip address192.168.2.1 255.255.255.0

SWB(config-router)# router ospf 123

SWB(config-router)#network 192.168.3.0 0.0.0.255area 0

SWB(config-router)#network 192.168.2.0 0.0.0.255area 0     



2) Configure OSPF and BFD linkage

SWB(config)#interface gigabitEthernet 2/1

SWB(config-GigabitEthernet 2/1)#bfd interval 500min_rx 500 multiplier 3     

SWB(config-GigabitEthernet 2/1)#no bfd echo        

SWB(config-router)#router ospf 123     

SWB(config-router)#bfd all-interfaces   



Note:
1) The BFD function does not support one-way detection; if the BFD function isto be configured, both ends of the device must support the BFD function at thesame time.
2) When configuring the BFD function, it isrecommended that the BFD echo function be disabled.

Verification:
1) Run the "show bfd neighbor" to confirmthe status of BFD neighbor
Ruijie#show bfd neighbors
OurAddr     NeighAddr    LD/RD  RH/RS Holdown(mult)  State  Int
192.168.3.1  192.168.3.2   1/2    Up     532 (3 )       Up    G2/1
2) View the details about BFD
Ruijie# show bfd neighbors details
OurAddr               NeighAddr     LD/RD             RH/RS Holdown(mult)           State   Int
192.168.3.1           192.168.3.2    1/2                  Up                  532 (3 )        Up  Ge2/1
Local Diag: 0, Demand mode: 0, Poll bit: 0
MinTxInt: 200000, MinRxInt: 200000, Multiplier: 5
Received MinRxInt: 50000, Received Multiplier: 3
Holdown (hits): 600(22), Hello (hits): 200(84453)
Rx Count: 49824, Rx Interval (ms) min/max/avg:208/440/332
Tx Count: 84488, Tx Interval (ms) min/max/avg:152/248/196
Registered protocols: OSPF
Uptime: 02:18:49
Last packet: Version: 1      - Diagnostic: 0
I Hear You bit: 1                           - Demand bit: 0
Poll bit: 0                                       - Finalbit: 0
Multiplier: 3                                 - Length: 24
My Discr.: 2                                              - Your Discr.: 1
Min tx interval: 50000                  - Min rx interval: 50000

Policy-based Routing and BFD linkage example
Case of Configuration
a) Requirement

The Layer 3 switches SWA and SWB are interconnected via the Layer 2 switch. Policy routes are configured on the devices to establish forwarding paths, while allowing policy routes to be associated with BFD applications on the interfaces of both sides. In the event of a link failure between SWB and the Layer 2 switch, BFD can quickly detect and notify the policy route, triggering the system to delete the policy route, thus avoiding routing errors.
b) Network Topology



c) Configuration

Configurationon SWA
1)Configureip and BFD session parameters on the interface g2/1

SWA>en

SWA# configure terminal

SWA(config)# interface GigabitEthernet2/1

SWA(config-if)# no switchport

SWA(config-if)# ip address 192.168.3.1255.255.255.0



SWA(config-if)# bfd interval 500 min_rx 500multiplier 5
------>Configure the BFD time parameter, this command alsoenables the BFD function of the interface, so it must be configured; 500/500/3is the recommended configuration here, sending a probe message at 500msinterval, and declaring the link failure if no response is received for 3consecutive times.
SWA(config-if)# no bfd echo
   ------>The default is bfd echo mode,at some times (such as there is a FW in the middle or docking devices of otherbrands) may filter the echo messages resulting in the BFD not being establishedsuccessfully, it is recommended to disable it.
2) Configure ip on the interface ge1/1

SWA(config-if)# exit

SWA(config)# interface GigabitEthernet1/1

SWA(config-if)# no switchport

SWA(config)# ip address 192.168.1.1 255.255.255.0



3) Configure policy-based route and associate BFDto detect the neighbor 192.168.3.2

SWA(config)# ip access-list extended 100

SWA(config-ext-nacl)# permit ip any 192.168.2.00.0.0.255

SWA(config-ext-nacl)# deny ip any any

SWA(config-ext-nacl)# exit

SWA(config)# route-map Example1 permit 10

SWA(config-route-map)# match ip address 100

SWA(config-route-map)# set ip precedence priority

SWA(config-route-map)#set ip next-hopverify-availability 192.168.3.2 bfd GigabitEthernet 0/1 192.168.3.2

SWA(config)# end

SWA#wr



Configurationon SWB:
1) Configure ip and BFD session parameters on theinterface g2/1

SWB>en

SWB#configure terminal

SWB(config)# interface GigabitEthernet 2/1

SWB(config-if)# no switchport

SWB(config-if)# ip address 192.168.3.2255.255.255.0

SWB(config-if)# bfd interval 500 min_rx 500multiplier 5

SWB(config-if)# no bfd echo



2) Configure ip on the interface ge1/1

SWB(config-if)# exit

SWB(config)# interface GigabitEthernet1/1

SWB(config-if)# no switchport

SWB(config)# ip address 192.168.2.1 255.255.255.0



3) Configure policy-based route and associate BFDto detect the neighbor 192.168.3.1

SWB(config)# ip access-list extended 100

SWB(config-ext-nacl)# permit ip any 192.168.1.00.0.0.255

SWB(config-ext-nacl)# deny ip any any

SWB(config-ext-nacl)# exit

SWB(config)# route-map Example1 permit 10

SWB(config-route-map)# match ip address 100

SWB(config-route-map)# set ip precedence priority

SWB(config-route-map)#set ip next-hopverify-availability 192.168.3.1 bfd GigabitEthernet 2/1 192.168.3.1

SWB(config)# end

SWB#wr



Note:
1) The BFD function does not support one-way detection; if the BFD function isto be configured, both ends of the device must support the BFD function at the same time.
2) When configuring the BFD function, it is recommended that the BFD echo function be disabled.
Verification: The same command on both switches
Ruijie# show bfd neighbors details
OurAddr               NeighAddr     LD/RD            RH/RS Holdown(mult)           State   Int
192.168.3.1           192.168.3.2    1/2                  Up                  532 (3 )        Up  Ge2/1
Local Diag: 0, Demand mode: 0, Poll bit: 0
MinTxInt: 200000, MinRxInt: 200000, Multiplier: 5
Received MinRxInt: 50000, Received Multiplier: 3
Holdown (hits): 600(22), Hello (hits): 200(84453)
Rx Count: 49824, Rx Interval (ms) min/max/avg:208/440/332
Tx Count: 84488, Tx Interval (ms) min/max/avg:152/248/196
Registeredprotocols: PBR   
Uptime: 02:18:49
Last packet: Version: 1     - Diagnostic: 0
I Hear You bit: 1                           - Demand bit: 0
Poll bit: 0                                      - Finalbit: 0
Multiplier: 3                                  - Length: 24
My Discr.: 2                                              - Your Discr.: 1
Min tx interval: 50000                  - Min rx interval: 50000
Min Echo interval: 0
RG-S6510-48VS8CQ

Configuration Switch
There are no replies.
Related Posts
Product Model

Share this topic to

Cancel

This site contains user submitted content, comments and opinions and is for informational purposes only. Ruijie may provide or recommend responses as a possible solution based on the information provided; every potential issue may involve several factors not detailed in the conversations captured in an electronic forum and Ruijie can therefore provide no guarantee as to the efficacy of any proposed solutions on the community forums. Ruijie disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Ruijie Community Terms of Use.

More ways to get help: Visit Support Videos, call us via Service Hotline, Facebook or Live Chat.

©2000-2023 Ruijie Networks Co,Ltd