BFD Configuration
Configuration Syntax and Commands
The following sections describe the Bidirectional Forwarding Detection configuration syntax and commands.
A static BFD session is configured by explicitly setting the local and peer IP addresses and interfaces along with the BFD parameters, such as 'transmit' and 'receive' intervals and 'detection multipliers'. The session is established directly between the two endpoints without depending on any routing protocol.
In contrast, a dynamic BFD session is automatically created and managed by a routing protocol, such as BGP.
Static BFD Session Configuration
A BFD session can be established through static configuration.
| Static BFD sessions support transmit and receive intervals of 1000 milliseconds. |
Syntax
| Attribute | Description |
|---|---|
|
The minimum number of consecutive BFD packets that must be missed before the BFD session is declared down. Range 2 - 255. Default 3. |
|
Logical interface name. |
|
Local IPv4 address. This is the IPv4 source address of BFD packets configured on the interface used in the session. |
|
Local IPv6 address. This is the IPv6 source address of BFD packets configured on the interface used in the session. |
|
Peer IPv4 address. |
|
Peer IPv6 address. |
|
The receive interval is the minimum amount of time (in milliseconds) that an RBFS device waits to receive a BFD control packet from its peer. Range: 100 - 10000. Default: 1000 milliseconds |
|
The transmit interval is the minimum amount of time (in milliseconds) that an RBFS device transmits BFD control packets to its peer. Range: 100 - 10000. Default: 1000 milliseconds. |
This configuration establishes two BFD sessions, named BFD_V4_IFP1_LINK1 and BFD_V6_IFP1_LINK1, for IPv4 and IPv6, respectively, on the same interface (ifl-0/0/0/0). Both sessions are set to a transmit/receive interval of 1000 milliseconds, meaning they exchange BFD packets once per second to quickly detect failures.
The peer IPv4 address, which is the neighbor’s IP address for BFD packets, is specified as 12.0.0.2, while the local IPv4 address is designated as 12.0.0.1. For IPv6, the peer address is set as 12::2, and the local address is specified as 12::1.
If no packet is received within the hold interval (calculated as receive interval × detect multiplier), the BFD session is declared down.
set oam bfd session BFD_V4_IFP1_LINK1 set oam bfd session BFD_V4_IFP1_LINK1 peer-v4-address 12.0.0.2 set oam bfd session BFD_V4_IFP1_LINK1 local-v4-address 12.0.0.1 set oam bfd session BFD_V4_IFP1_LINK1 transmit-interval 1000 set oam bfd session BFD_V4_IFP1_LINK1 receive-interval 1000 set oam bfd session BFD_V4_IFP1_LINK1 interface ifl-0/0/0/0 set oam bfd session BFD_V6_IFP1_LINK1 set oam bfd session BFD_V6_IFP1_LINK1 peer-v6-address 12::2 set oam bfd session BFD_V6_IFP1_LINK1 local-v6-address 12::1 set oam bfd session BFD_V6_IFP1_LINK1 transmit-interval 1000 set oam bfd session BFD_V6_IFP1_LINK1 receive-interval 1000 set oam bfd session BFD_V6_IFP1_LINK1 interface ifl-0/0/0/0
{
"rtbrick-config:session": [
{
"name": "BFD_V4_IFP1_LINK1",
"peer-v4-address": "12.0.0.2",
"local-v4-address": "12.0.0.1",
"transmit-interval": 1000,
"receive-interval": 1000,
"interface": "ifl-0/0/0/0"
},
{
"name": "BFD_V6_IFP1_LINK1",
"peer-v6-address": "12::2",
"local-v6-address": "12::1",
"transmit-interval": 1000,
"receive-interval": 1000,
"interface": "ifl-0/0/0/0"
}
]
}
Enabling BFD for Static Routes
RBFS supports tracking static routes through static BFD sessions. When a static BFD session moves to the down state, all the static routes associated with that session are automatically removed from the system. This ensures quick and reliable route failover.
To enable this feature, you must configure a static conditional profile with:
-
compare-type:bfd-session-up(It means the condition is satisfied only when the BFD session is UP). -
match-bfd-session(the specific BFD session that you want to track).
After creating the conditional profile, attach it to the static routes that need monitoring. Once applied, these routes will remain active only while the corresponding static BFD session is operational.
Static BFD Conditional Profile Configuration
Syntax:
Static Route Configuration with Conditional Profile:
Linking Conditional Profile to Static Route:
| Attribute | Description |
|---|---|
|
Name of the instance. |
|
Name of the next-hop profile. |
|
Name of the conditional profile. |
|
Name of the BFD session. |
This configuration creates a conditional profile 'cp1' for static routes. The profile is used to track the status of a specific BFD session. The 'compare-type' is defined as bfd-session-up, it indicates the condition is satisfied only when the BFD session is UP. The match-bfd-session is specified as BFD_V4_IFP1_LINK0. Static routes that use this conditional profile will stay installed only when the BFD session 'BFD_V4_IFP1_LINK0' is UP. If the BFD session goes down, the routes are automatically withdrawn.
The route uses a next-hop profile np1 and is associated to the conditional profile 'cp1'. It means the route will be installed only if the condition in 'cp1' is met.
This configuration is used to ensure the static route is only installed when the monitored path is reachable. If the BFD session S1 goes down, the route is automatically withdrawn. It prevents traffic from being sent down an inactive path.
set instance default static route ipv4 192.168.0.26/32 unicast np1 conditional-profile cp1 set instance default static nexthop-profile np1 nexthop 12.0.0.2 set instance default static conditional-profile cp1 compare-type bfd-session-up set instance default static conditional-profile cp1 match-bfd-session BFD_V4_IFP1_LINK0
supervisor@rtbrick.net: cfg> show config instance default static
{
"rtbrick-config:static": {
"route": {
"ipv4": [
{
"prefix4": "182.168.0.26/32",
"safi": "unicast",
"nexthop-profile": "np1",
"conditional-profile": [
"cp1"
]
}
]
},
"nexthop-profile": [
{
"name": "np1",
"nexthop": "12.0.0.2"
}
],
"conditional-profile": [
{
"name": "cp1",
"compare-type": "bfd-session-up",
"match-bfd-session": "BFD_V4_IFP1_LINK0"
}
]
}
}
BFD Profile Configuration
A BFD profile contains the parameters that controls the behavior of BFD sessions. You can create BFD profiles that allow you to define common BFD parameters (such as transmit and receive intervals, detect multipliers) in the profile and associate them with the BGP, OSPF or IS-IS protocols.
Syntax
| Attribute | Description |
|---|---|
|
Name of the BFD profile. |
|
The minimum number of consecutive BFD packets that must be missed before the BFD session is declared down. Range 2 - 255. Default 3. |
|
The receive interval is the minimum amount of time (in milliseconds) that an RBFS device waits to receive a BFD control packet from its peer. Range: 100 - 10000. Default: 1000 milliseconds |
|
The transmit interval is the minimum amount of time (in milliseconds) that an RBFS device transmits BFD control packets to its peer. Range: 100- 10000. Default: 1000 milliseconds. |
Example: BFD profile configuration
The following configuration creates a BFD profile named 'BGP_BFD_PROFILE1'. In this configuration, both the transmit interval and the receive interval are set to 1000 milliseconds, while the detect multiplier is defined as 3. It also defines the number of consecutive missed BFD packets required to declare the session as down.
set oam bfd profile BGP_BFD_PROFILE1 set oam bfd profile BGP_BFD_PROFILE1 transmit-interval 1000 set oam bfd profile BGP_BFD_PROFILE1 receive-interval 1000 set oam bfd profile BGP_BFD_PROFILE1 detect-multiplier 3
{
"rtbrick-config:profile": [
{
"name": "BGP_BFD_PROFILE1",
"transmit-interval": 1000,
"receive-interval": 1000,
"detect-multiplier": 3
}
]
}
Attaching BFD Profile to BGP
After creating a BFD profile, you can attach the profile to BGP prot
Syntax
| Attribute | Description |
|---|---|
|
Name of the BFD profile. |
|
Name of the interface. |
|
Local IPv4 and IPv6 address. |
|
Peer IPv4 and IPv6 address. |
The following configuration attaches a BFD for different BGP peers in the default routing instance. The BFD profile named 'BGP_BFD_PROFILE1' is attached to the BGP peer interface 'ifl-0/0/0/6, IPv4 and IPv6 addresses (IPv4 local: 12.0.4.2, peer: 12.0.4.1 and IPv6 local: 12:0:5::2, peer 12:0:5::1). This means that the BGP peer with these IP addresses will utilize the BFD parameters specified in BGP_BFD_PROFILE1. Any BGP peer that connects to this interface will automatically inherit the BFD settings. Once a BFD profile is attached to a peer group, all peers within that group will receive those BFD parameters.
set instance default protocol bgp peer interface ifl-0/0/0/6 bfd-profile BGP_BFD_PROFILE1 set instance default protocol bgp peer ipv4 12.0.4.2 12.0.4.1 bfd-profile BGP_BFD_PROFILE1 set instance default protocol bgp peer ipv6 12:0:5::2 12:0:5::1 bfd-profile BGP_BFD_PROFILE1
{
"rtbrick-config:peer": {
"interface": [
{
"name": "ifl-0/0/0/6",
"bfd-profile": "BGP_BFD_PROFILE1",
"peer-group": "ipv6_bgp_ll"
}
],
"ipv4": [
{
"peer-address": "12.0.4.2",
"update-source": "12.0.4.1",
"bfd-profile": "BGP_BFD_PROFILE1",
"peer-group": "ipv4_bgp"
}
],
"ipv6": [
{
"peer-address": "12:0:5::2",
"update-source": "12:0:5::1",
"bfd-profile": "BGP_BFD_PROFILE1",
"peer-group": "ipv6_bgp"
}
]
}
}
Attaching BFD Profile on IS-IS Interface
Once the BFD profile is created, you can attach the BFD profile on IS-IS interface.
Syntax
| Attribute | Description |
|---|---|
|
Name of the instance. |
|
Name of the interface. |
|
Name of the BFD profile. |
Example:
This configuration applies the BFD profile 'BFD_PROFILE_100MSx2' to the IS-IS interface 'ifl-0/0/0/0' so that IS-IS can detect adjacency link failures within 200 milliseconds.
set instance default protocol isis interface ifl-0/0/0/0 set instance default protocol isis interface ifl-0/0/0/0 bfd-profile BFD_PROFILE_100MSx2
{
"rtbrick-config:interface": [
{
"name": "ifl-0/0/0/0",
"bfd-profile": "BFD_PROFILE_100MSx2"
}
]
}
Enabling BFD for OSPFv2
Once the BFD profile is created, you can attach the BFD profile on the OSPFv2 interface.
Syntax:
| Attribute | Description |
|---|---|
|
Name of the instance. |
|
OSPFv2 area identifier. |
|
Name of the interface. |
|
Name of the BFD profile. |
Example:
This configuration applies the BFD profile 'PROTOCOL_BFD_PROFILE5' to the OSPFv2 area 0.0.0.0 interface 'ifl-0/0/0/11', enabling OSPFv2 to detect neighbor link failures within 200 milliseconds.
set instance default protocol ospf address-family ipv4 area 0.0.0.0 interface ifl-0/0/0/11 set instance default protocol ospf address-family ipv4 area 0.0.0.0 interface ifl-0/0/0/11 bfd-profile PROTOCOL_BFD_PROFILE5
{
"rtbrick-config:interface": [
{
"name": "ifl-0/0/0/11",
"bfd-profile": "PROTOCOL_BFD_PROFILE5"
}
]
}
Enabling BFD for OSPFv3
Once the BFD profile is created, you can attach the BFD profile on the OSPFv3 interface.
Syntax:
| Attribute | Description |
|---|---|
|
Name of the instance. |
|
OSPFv2 area identifier. |
|
IPv6 instance identifier. |
|
Name of the interface. |
|
Name of the BFD profile. |
Example:
This configuration applies the BFD profile PROTOCOL_BFD_PROFILE5 to the OSPFv3 interface ifl-0/0/0/11, enabling the interface to use the profile’s defined BFD timers and detection parameters. It is configured under the IPv6 address family with instance-id 0 in area 0.0.0.0, ensuring OSPFv3 adjacencies on this interface use consistent BFD behavior.
set instance default protocol ospf address-family ipv6 instance-id 0 area 0.0.0.0 interface ifl-0/0/0/11 set instance default protocol ospf address-family ipv6 instance-id 0 area 0.0.0.0 interface ifl-0/0/0/11 bfd-profile PROTOCOL_BFD_PROFILE5
{
"rtbrick-config:interface": [
{
"name": "ifl-0/0/0/11",
"bfd-profile": "PROTOCOL_BFD_PROFILE5"
}
]
}
Control Plane QoS Outbound Marking for BFD
You can configure Control Plane QoS outbound marking for BFD packets by specifying the DSCP value for BFD packets based on the routing protocol.
Syntax:
| Attribute | Description |
|---|---|
|
Specifies the routing protocol for which to configure the DSCP marking for BFD packets. |
|
Specifies whether to use TOS or P-bit for marking. |
|
Specifies the physical interface (IFP) on which to apply the marking. |
|
Specifies the DSCP codepoint value to be used for marking BFD packets. |
Example:
The following command configures control-plane QoS so that all outgoing BFD packets sent by the device are remarked with a specific type of service (ToS) codepoint value 100.
set forwarding-options class-of-service control-plane-qos outbound-marking protocol bfd tos codepoint 100
supervisor@rtbrick.net: cfg> show config forwarding-options class-of-service control-plane-qos outbound-marking protocol bfd
{
"rtbrick-config:protocol": [
{
"protocol": "bfd",
"remark-type": "tos",
"codepoint": 100
}
]
}