You need to globally configure the functions required for static and dynamic BFD, including enabling the global BFD function (mandatory) and delaying the Up state change of the BFD session (optional), configuring the default multicast address for one-hop BFD (optional), and enabling passive echo (optional).
Enabling the global BFD function is mandatory when configuring BFD. When you enable the global BFD function, the BFD view is displayed. In the BFD view, you can configure the following global optional functions based on your network requirements:
Delaying the Up State Change of the BFD Session
In actual networking, some devices enable traffic switchover based on the BFD session status. However, the routing protocol becomes Up later than the interface. As a result, traffic fails to find the route when switched back, and is therefore lost. After you delay the Up state change of the BFD session, the session will become Up a period after the fault is rectified, making up the defect that the routing protocol becomes Up later than the interface.
Configuring the Default Multicast Address for One-hop BFD
When you perform one-hop BFD on the Layer-3 physical interfaces without IP addresses or Layer-2 interfaces, use the default multicast IP address.
By default, the default multicast IP address for BFD is 224.0.0.184.
If the Layer-2 interfaces of the two devices are connected through a Layer-2 switch that provides the BFD function, and multicast IP addresses are used to set up BFD sessions, when the global BFD function is enabled on the switch, run the default-ip-address command to configure different default multicast IP addresses for the two devices and switch. Otherwise, the switch cannot forward the BFD multicast packets, resulting in BFD session interruption.
Enabling Passive Echo
The BFD passive echo function enables the device to communicate with an echo-supported device on the network. This function applies only to one-hop detection.
system-view
bfd
delay-up seconds
By default, the Up state change delay of the BFD session is 0 second. That is, the Up state change of the BFD session is not delayed.
default-ip-address ip-address
Currently, multicast address detection is supported only in BFD for IPv4 but not BFD for IPv6. Therefore, this command is applicable in only IPv4.
echo-passive { all | acl basic-acl-number }
BFD echo packets loop back through ICMP redirection on the peer end. In an IP packet encapsulating the BFD echo packet, the destination address and source address are both the IP address of the local outbound interface. Therefore, the ACL rule must allow the source IP addresses of both the local end and peer end.
peer-ip peer-ip mask-length ttl { single-hop | multi-hop } ttl-value
Set the TTL of the BFD packet.
The default TTL of the BFD packet varies with the BFD session type. In static BFD sessions, the TTL of the single-hop BFD packet is 255 and the TTL of the multi-hop BFD packet is 254. In dynamic BFD sessions, the TTL of the single-hop BFD packet is 255; the TTL of the multi-hop BFD packet is 253.
You can use this command to set the TTL globally to enable Huawei devices running different FW versions to interwork with each other and non-Huawei devices.
multi-hop destination-port { 3784 | 4784 }
Configure the number of the default destination port for the multi-hop BFD control packet.
By default, destination port 3784 is used for the multi-hop BFD control packet.
According to the BFD draft, 4784 is the destination port number of multi-hop BFD session packets.
During interworking with devices of earlier versions, the FW chooses 3784 as the destination port number of multi-hop BFD session packets. During interworking with the devices of other vendors, the FW uses 4784 as the destination port number of multi-hop BFD session packets.