BFD Configuration
show bfd peers
Section titled “show bfd peers”[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 briefSession count: 3SessionId LocalAddress PeerAddress Status========= ============ =========== ======3607940072 30.11.13.130 30.11.13.129 down3035614313 2022::9111 2022::9110 up1781668247 30.11.13.2 30.11.13.1 upshow bfd peers counters
Section titled “show bfd peers counters”[Command] show bfd peers counters clear bfd peers counters
[Purpose] View BFD session statistics
[View] System view
[Use Cases]
sonic# show bfd peers countersBFD 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: 3show bfd peers log-info
Section titled “show bfd peers log-info”[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.2Peer address : 1.1.1.1Date/Time : 2024-12-09 09:00:43State : UpDate/Time : 2024-12-09 09:00:23State : DownDown reason : administratively downDate/Time : 2024-12-09 08:52:45State : Up[Command] bfd
[Purpose] Enter BFD configuration view
[View] System configuration view
[Use Cases]
sonic(config)# bfdsonic(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]
| Parameter | Description |
|---|---|
| ip_address | IP address of the counterpart to which the BFD session is bound |
| multihop | Specify 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)# bfdsonic(config-bfd)# peer 30.11.13.1 interface ethernet 49profile
Section titled “profile”[Command] profile profile_name no profile profile_name
[Purpose] Configure BFD policy group/bind specified policy group to peer
[Parameter]
| Parameter | Description |
|---|---|
| profile_name | Profile 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)# bfdsonic(config-bfd)# profile testsonic(config-bfd-profile)# detect-multiplier 3sonic(config-bfd-profile)# exitsonic(config-bfd)# peer 30.11.13.1sonic(config-bfd-peer)# profile testdetect-multiplier
Section titled “detect-multiplier”[Command] detect-multiplier* value*
[Purpose] Local detection multiplier for BFD sessions
[Parameter]
| Parameter | Description |
|---|---|
| value | Value 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)# bfdsonic(config-bfd)# peer 30.11.13.1sonic(config-bfd-peer)# detect-multiplier 3echo-mode
Section titled “echo-mode”[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)# bfdsonic(config-bfd)# peer 30.11.13.1sonic(config-bfd-peer)# echo modeecho-interval
Section titled “echo-interval”[Command] echo-interval value
[Purpose] Configure the minimum reception interval of BFD packets for the single-arm echo function
[Parameter]
| Parameter | Description |
|---|---|
| value | Value range: 10-60000, unit: ms |
[View] BFD-peer view, BFD-profile view
[Use Cases]
sonic(config)# bfdsonic(config-bfd)# peer 30.11.13.1sonic(config-bfd-peer)# echo modesonic(config-bfd-peer)# echo-interval 20minimum-ttl
Section titled “minimum-ttl”[Command] minimum-ttl value
[Purpose] Configure the survival time of BFD packets
[Parameter]
| Parameter | Description |
|---|---|
| value | Value range: 1-254 |
[View] BFD-peer view, BFD-profile view
[Use Cases]
sonic(config)# bfdsonic(config-bfd)# peer 30.11.13.1sonic(config-bfd-peer)# minimum-ttl 254passive-mode
Section titled “passive-mode”[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)# bfdsonic(config-bfd)# peer 30.11.13.1sonic(config-bfd-peer)# passive-modereceive-interval
Section titled “receive-interval”[Command] receive-interval value
[Purpose] Configure the reception interval of BFD packets
[Parameter]
| Parameter | Description |
|---|---|
| value | Value range: 10-60000, unit: ms |
[View] BFD-peer view, BFD-profile view
[Use Cases]
sonic(config)# bfdsonic(config-bfd)# peer 30.11.13.1sonic(config-bfd-peer)# receive-interval 10shutdown
Section titled “shutdown”[Command] shutdown no shutdown
[Purpose] Abort BFD session detection
[View] BFD-peer view, BFD-profile view
[Use Cases]
sonic(config)# bfdsonic(config-bfd)# peer 30.11.13.1sonic(config-bfd-peer)# shutdowntransmit-interval
Section titled “transmit-interval”[Command] transmit-interval value
[Purpose] Configure the sending interval of BFD packets
[Parameter]
| Parameter | Description |
|---|---|
| value | Value range: 10-60000, unit: ms |
[View] BFD-peer view, BFD-profile view
[Use Cases]
sonic(config)# bfdsonic(config-bfd)# peer 30.11.13.1sonic(config-bfd-peer)# transmit-interval 20