Skip to content
Ask AI

BFD Configuration

[Command] show bfd peer show bfd peers show bfd peers brief

[Purpose] View BFD session information

[View] System view

[Use Cases]

sonic# show bfd peers brief
Session count: 3
SessionId LocalAddress PeerAddress Status
========= ============ =========== ======
3607940072 30.11.13.130 30.11.13.129 down
3035614313 2022::9111 2022::9110 up
1781668247 30.11.13.2 30.11.13.1 up

[Command] show bfd peers counters clear bfd peers counters

[Purpose] View BFD session statistics

[View] System view

[Use Cases]

sonic# show bfd peers counters
BFD Peers:
peer 30.11.13.129 vrf default interface ethernet 50
Control packet input: 300387 packets
Control packet output: 300181 packets
Echo packet input: 0 packets
Echo packet output: 0 packets
Session up events: 1
Session down events: 1
Zebra notifications: 3

[Command] show bfd peers log-info

[Purpose] View the BFD status

[View] System view

[Use Cases]

sonic# show bfd peers log-info
--------------------------------------------------
Local address : 1.1.1.2
Peer address : 1.1.1.1
Date/Time : 2024-12-09 09:00:43
State : Up
Date/Time : 2024-12-09 09:00:23
State : Down
Down reason : administratively down
Date/Time : 2024-12-09 08:52:45
State : Up

[Command] bfd

[Purpose] Enter BFD configuration view

[View] System configuration view

[Use Cases]

sonic(config)# bfd
sonic(config-bfd)#

[Command] peer ip_address [multihop|local-address ip-address |interface interface_type interface_name ] no peer [multihop|local-address ip-address |interface interface_type interface_name ]

[Purpose] Create BFD session binding information and enter BFD-peer view

[Parameter]

ParameterDescription
ip_addressIP address of the counterpart to which the BFD session is bound
multihopSpecify the BFD session as multi-hop mode
local-address <ip_address>Specify the source IP address of the BFD packet
interface <interface_type> <interface_name>Specify the interface type and name of the BFD session

[View] BFD View

[Use Cases]

sonic(config)# bfd
sonic(config-bfd)# peer 30.11.13.1 interface ethernet 49

[Command] profile profile_name no profile profile_name

[Purpose] Configure BFD policy group/bind specified policy group to peer

[Parameter]

ParameterDescription
profile_nameProfile name

[View] BFD View, BFD-peer View

[Usage Scenario] When creating a large number of Bidirectional Forwarding Detection (BFD) sessions on a device, configuring peer policies one by one can significantly reduce configuration efficiency. Therefore, configuring BFD policy groups and then binding the policy group to peers can effectively streamline the configuration process.

[Use Cases]

sonic(config)# bfd
sonic(config-bfd)# profile test
sonic(config-bfd-profile)# detect-multiplier 3
sonic(config-bfd-profile)# exit
sonic(config-bfd)# peer 30.11.13.1
sonic(config-bfd-peer)# profile test

[Command] detect-multiplier* value*

[Purpose] Local detection multiplier for BFD sessions

[Parameter]

ParameterDescription
valueValue range: 2-255

[View] BFD-peer view, BFD-profile view

[Usage Scenario] The local detection multiplier of a BFD session directly determines the detection time for the remote BFD session. Users can increase or decrease the local detection multiplier of a BFD session based on the actual network conditions. For example, on a relatively stable link where frequent detection of link status is not necessary, users can increase the local detection multiplier of a BFD session. BFD Detection Time = Detection Multiplier x Transmission Interval

[Notes] For less stable links, configuring a small detection multiplier for a BFD session may lead to BFD session oscillations. It is recommended that users configure the detection time multiplier to a larger value. If the detection multiplier for a configured BFD session is too large, the BFD session needs a longer time interval to detect a link failure. During this time period, traffic needs to switch to a backup link within a specified time. Packet loss may occur during this period. It is advisable to carefully choose the detection multiplier based on the actual network conditions and the requirements for fault detection.

[Use Cases]

sonic(config)# bfd
sonic(config-bfd)# peer 30.11.13.1
sonic(config-bfd-peer)# detect-multiplier 3

[Command] echo-mode no echo-mode

[Purpose] Configure the BFD session as a single-arm echo function

[View] BFD-peer view, BFD-profile view

[Usage Scenario] Among two directly connected devices, one of them supports BFD function and the other one does not support BFD function. In this case, in order to detect link failures more quickly, a single-arm echo-capable BFD session can be created on the device that supports the BFD function. After the device that does not support BFD function receives a BFD packet, it directly loops the packet back at the IP layer, so as to achieve the purpose of fast link detection.

[Use Cases]

sonic(config)# bfd
sonic(config-bfd)# peer 30.11.13.1
sonic(config-bfd-peer)# echo mode

[Command] echo-interval value

[Purpose] Configure the minimum reception interval of BFD packets for the single-arm echo function

[Parameter]

ParameterDescription
valueValue range: 10-60000, unit: ms

[View] BFD-peer view, BFD-profile view

[Use Cases]

sonic(config)# bfd
sonic(config-bfd)# peer 30.11.13.1
sonic(config-bfd-peer)# echo mode
sonic(config-bfd-peer)# echo-interval 20

[Command] minimum-ttl value

[Purpose] Configure the survival time of BFD packets

[Parameter]

ParameterDescription
valueValue range: 1-254

[View] BFD-peer view, BFD-profile view

[Use Cases]

sonic(config)# bfd
sonic(config-bfd)# peer 30.11.13.1
sonic(config-bfd-peer)# minimum-ttl 254

[Command] passive-mode no passive-mode

[Purpose] Configure the operation mode of BFD as passive mode

[View] BFD-peer view, BFD-profile view

[Notes] This command switches the operation mode of BFD to active mode.

[Use Cases]

sonic(config)# bfd
sonic(config-bfd)# peer 30.11.13.1
sonic(config-bfd-peer)# passive-mode

[Command] receive-interval value

[Purpose] Configure the reception interval of BFD packets

[Parameter]

ParameterDescription
valueValue range: 10-60000, unit: ms

[View] BFD-peer view, BFD-profile view

[Use Cases]

sonic(config)# bfd
sonic(config-bfd)# peer 30.11.13.1
sonic(config-bfd-peer)# receive-interval 10

[Command] shutdown no shutdown

[Purpose] Abort BFD session detection

[View] BFD-peer view, BFD-profile view

[Use Cases]

sonic(config)# bfd
sonic(config-bfd)# peer 30.11.13.1
sonic(config-bfd-peer)# shutdown

[Command] transmit-interval value

[Purpose] Configure the sending interval of BFD packets

[Parameter]

ParameterDescription
valueValue range: 10-60000, unit: ms

[View] BFD-peer view, BFD-profile view

[Use Cases]

sonic(config)# bfd
sonic(config-bfd)# peer 30.11.13.1
sonic(config-bfd-peer)# transmit-interval 20