Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Configuring BFD

Use the following examples to configure Bidirectional Forwarding Detection (BFD) on your device.

Example: Configuring BFD for Static Routes for Faster Network Failure Detection

This example shows how to configure Bidirectional Forwarding Detection (BFD) for static routes.

Requirements

In this example, no special configuration beyond device initialization is required.

Overview

There are many practical applications for static routes. Static routing is often used at the network edge to support attachment to stub networks, which, given their single point of entry and egress, are well suited to the simplicity of a static route. In Junos OS, static routes have a global preference of 5. Static routes are activated if the specified next hop is reachable.

In this example, you configure the static route 192.168.47.0/24 from the provider network to the customer network, using the next-hop address of 172.16.1.2. You also configure a static default route of 0.0.0.0/0 from the customer network to the provider network, using a next-hop address of 172.16.1.1.

For demonstration purposes, some loopback interfaces are configured on Device B and Device D. These loopback interfaces provide addresses to ping and thus verify that the static routes are working.

Figure 1 shows the sample network.

Figure 1: Customer Routes Connected to a Service ProviderCustomer Routes Connected to a Service Provider

Topology

Configuration

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Device B

Device D

Procedure

Step-by-Step Procedure

The following example requires that you navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide.

To configure BFD for static routes:

  1. On Device B, configure the interfaces.

  2. On Device B, create a static route and set the next-hop address.

  3. On Device B, configure BFD for the static route.

  4. On Device B, configure tracing operations for BFD.

  5. If you are done configuring Device B, commit the configuration.

  6. On Device D, configure the interfaces.

  7. On Device D, create a static route and set the next-hop address.

  8. On Device D, configure BFD for the static route.

  9. On Device D, configure tracing operations for BFD.

  10. If you are done configuring Device D, commit the configuration.

Results

Confirm your configuration by issuing the show interfaces, show protocols, and show routing-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

Device B

Device D

Verification

Confirm that the configuration is working properly.

Verifying That BFD Sessions Are Up

Purpose

Verify that the BFD sessions are up, and view details about the BFD sessions.

Action

From operational mode, enter the show bfd session extensive command.

Note:

The description Site- <xxx> is supported only on the SRX Series Firewalls.

If each client has more than one description field, then it displays "and more" along with the first description field.

Meaning

The TX interval 1.000, RX interval 1.000 output represents the setting configured with the minimum-interval statement. All of the other output represents the default settings for BFD. To modify the default settings, include the optional statements under the bfd-liveness-detection statement.

Viewing Detailed BFD Events

Purpose

View the contents of the BFD trace file to assist in troubleshooting, if needed.

Action

From operational mode, enter the file show /var/log/bfd-trace command.

Meaning

BFD messages are being written to the trace file.

Example: Configuring BFD on Internal BGP Peer Sessions

This example shows how to configure internal BGP (IBGP) peer sessions with the Bidirectional Forwarding Detection (BFD) protocol to detect failures in a network.

Requirements

No special configuration beyond device initialization is required before you configure this example.

Overview

The minimum configuration to enable BFD on IBGP sessions is to include the bfd-liveness-detection minimum-interval statement in the BGP configuration of all neighbors participating in the BFD session. The minimum-interval statement specifies the minimum transmit and receive intervals for failure detection. Specifically, this value represents the minimum interval after which the local routing device transmits hello packets as well as the minimum interval that the routing device expects to receive a reply from a neighbor with which it has established a BFD session. You can configure a value from 1 through 255,000 milliseconds.

Optionally, you can specify the minimum transmit and receive intervals separately using the transmit-interval minimum-interval and minimum-receive-interval statements. For information about these and other optional BFD configuration statements, see bfd-liveness-detection.

Note:

BFD is an intensive protocol that consumes system resources. Specifying a minimum interval for BFD less than 100 milliseconds for Routing Engine-based sessions and less than 10 milliseconds for distributed BFD sessions can cause undesired BFD flapping.

Depending on your network environment, these additional recommendations might apply:

  • To prevent BFD flapping during the general Routing Engine switchover event, specify a minimum interval of 5000 milliseconds for Routing Engine-based sessions. This minimum value is required because, during the general Routing Engine switchover event, processes such as RPD, MIBD, and SNMPD utilize CPU resources for more than the specified threshold value. Hence, BFD processing and scheduling is affected because of this lack of CPU resources.

  • For BFD sessions to remain up during the dual chassis cluster control link scenario, when the first control link fails, specify the minimum interval of 6000  milliseconds to prevent the LACP from flapping on the secondary node for Routing Engine-based sessions.

  • For large-scale network deployments with a large number of BFD sessions, specify a minimum interval of 300 milliseconds for Routing Engine-based sessions and 100 milliseconds for distributed BFD sessions.

  • For very large-scale network deployments with a large number of BFD sessions, contact Juniper Networks customer support for more information.

  • For BFD sessions to remain up during a Routing Engine switchover event when nonstop active routing (NSR) is configured, specify a minimum interval of 2500 milliseconds for Routing Engine-based sessions. For distributed BFD sessions with NSR configured, the minimum interval recommendations are unchanged and depend only on your network deployment.

BFD is supported on the default routing instance (the main router), routing instances, and logical systems. This example shows BFD on logical systems.

Figure 2 shows a typical network with internal peer sessions.

Figure 2: Typical Network with IBGP SessionsTypical Network with IBGP Sessions

Configuration

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Device A

Device B

Device C

Configuring Device A

Step-by-Step Procedure

The following example requires that you navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure Device A:

  1. Set the CLI to Logical System A.

  2. Configure the interfaces.

  3. Configure BGP.

    The neighbor statements are included for both Device B and Device C, even though Device A is not directly connected to Device C.

  4. Configure BFD.

    You must configure the same minimum interval on the connecting peer.

  5. (Optional) Configure BFD tracing.

  6. Configure OSPF.

  7. Configure a policy that accepts direct routes.

    Other useful options for this scenario might be to accept routes learned through OSPF or local routes.

  8. Configure the router ID and the autonomous system (AS) number.

  9. If you are done configuring the device, enter commit from configuration mode. Repeat these steps to configure Device B and Device C.

Results

From configuration mode, confirm your configuration by entering the show interfaces, show policy-options, show protocols, and show routing-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

Verification

Confirm that the configuration is working properly.

Verifying That BFD Is Enabled

Purpose

Verify that BFD is enabled between the IBGP peers.

Action

From operational mode, enter the show bgp neighbor command. You can use the | match bfd filter to narrow the output.

Meaning

The output shows that Logical System A has two neighbors with BFD enabled. When BFD is not enabled, the output displays BFD: disabled, down, and the <BfdEnabled> option is absent. If BFD is enabled and the session is down, the output displays BFD: enabled, down. The output also shows that BFD-related events are being written to a log file because trace operations are configured.

Verifying That BFD Sessions Are Up

Purpose

Verify that the BFD sessions are up, and view details about the BFD sessions.

Action

From operational mode, enter the show bfd session extensive command.

Meaning

The TX interval 1.000, RX interval 1.000 output represents the setting configured with the minimum-interval statement. All of the other output represents the default settings for BFD. To modify the default settings, include the optional statements under the bfd-liveness-detection statement.

Viewing Detailed BFD Events

Purpose

View the contents of the BFD trace file to assist in troubleshooting, if needed.

Action

From operational mode, enter the file show /var/log/A/bgp-bfd command.

Meaning

Before the routes are established, the No route to host message appears in the output. After the routes are established, the last two lines show that both BFD sessions come up.

Viewing Detailed BFD Events After Deactivating and Reactivating a Loopback Interface

Purpose

Check to see what happens after bringing down a router or switch and then bringing it back up. To simulate bringing down a router or switch, deactivate the loopback interface on Logical System B.

Action
  1. From configuration mode, enter the deactivate logical-systems B interfaces lo0 unit 2 family inet command.

  2. From operational mode, enter the file show /var/log/A/bgp-bfd command.

  3. From configuration mode, enter the activate logical-systems B interfaces lo0 unit 2 family inet command.

  4. From operational mode, enter the file show /var/log/A/bgp-bfd command.

Example: Configuring BFD for OSPF

This example shows how to configure the Bidirectional Forwarding Detection (BFD) protocol for OSPF.

Requirements

Before you begin:

Overview

An alternative to adjusting the OSPF hello interval and dead interval settings to increase route convergence is to configure BFD. The BFD protocol is a simple hello mechanism that detects failures in a network. The BFD failure detection timers have shorter timer limits than the OSPF failure detection mechanisms, thereby providing faster detection.

BFD is useful on interfaces that are unable to detect failure quickly, such as Ethernet interfaces. Other interfaces, such as SONET interfaces, already have built-in failure detection. Configuring BFD on those interfaces is unnecessary.

You configure BFD on a pair of neighboring OSPF interfaces. Unlike the OSPF hello interval and dead interval settings, you do not have to enable BFD on all interfaces in an OSPF area.

In this example, you enable failure detection by including the bfd-liveness-detection statement on the neighbor OSPF interface fe-0/1/0 in area 0.0.0.0 and configure the BFD packet exchange interval to 300 milliseconds, configure 4 as the number of missed hello packets that causes the originating interface to be declared down, and configure BFD sessions only for OSPF neighbors with full neighbor adjacency by including the following settings:

  • full-neighbors-only—In Junos OS Release 9.5 and later, configures the BFD protocol to establish BFD sessions only for OSPF neighbors with full neighbor adjacency. The default behavior is to establish BFD sessions for all OSPF neighbors.

  • minimum-interval—Configures the minimum interval, in milliseconds, after which the local routing device transmits hello packets as well as the minimum interval after which the routing device expects to receive a reply from the neighbor with which it has established a BFD session. You can configure a number in the range from 1 through 255,000 milliseconds. You can also specify the minimum transmit and receive intervals separately using the transmit-interval minimum-interval and minimum-receive-interval statements.

    Note:

    BFD is an intensive protocol that consumes system resources. Specifying a minimum interval for BFD of less than 100 ms for Routing Engine-based sessions and 10 ms for distributed BFD sessions can cause undesired BFD flapping.

    Depending on your network environment, these additional recommendations might apply:

    • For large-scale network deployments with a large number of BFD sessions, specify a minimum interval of no less than 500 ms. An interval of 1000 ms is recommended to avoid any instability issues.

      Note:
      • For the bfdd process, the detection time interval set is lower than 300 ms. If there is a high priority process such as ppmd running on the system, the CPU might spend time on the ppmd process rather than the bfdd process.

      • For branch SRX Series Firewalls, we recommend 1000 ms as the minimum keepalive time interval for BFD packets.

      • For vSRX 3.0, we recommend 300 ms as the minimum keepalive time interval for BFD packets.

    • For very large-scale network deployments with a large number of BFD sessions, contact Juniper Networks customer support for more information.

    • For BFD sessions to remain up during a Routing Engine switchover event when nonstop active routing (NSR) is configured, specify a minimum interval of 2500 ms for Routing Engine-based sessions. For distributed BFD sessions with NSR configured, the minimum interval recommendations are unchanged and depend only on your network deployment.

  • multiplier—Configures the number of hello packets not received by a neighbor that causes the originating interface to be declared down. By default, three missed hello packets cause the originating interface to be declared down. You can configure a value in the range from 1 through 255.

Topology

Configuration

Procedure

CLI Quick Configuration

To quickly configure the BFD protocol for OSPF, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, copy and paste the commands into the CLI at the [edit] hierarchy level, and then enter commit from configuration mode.

Step-by-Step Procedure

To configure the BFD protocol for OSPF on one neighboring interface:

  1. Create an OSPF area.

    Note:

    To specify OSPFv3, include the ospf3 statement at the [edit protocols] hierarchy level.

  2. Specify the interface.

  3. Specify the minimum transmit and receive intervals.

  4. Configure the number of missed hello packets that cause the originating interface to be declared down.

  5. Configure BFD sessions only for OSPF neighbors with full neighbor adjacency.

  6. If you are done configuring the device, commit the configuration.

    Note:

    Repeat this entire configuration on the other neighboring interface.

Results

Confirm your configuration by entering the show protocols ospf command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

To confirm your OSPFv3 configuration, enter the show protocols ospf3 command.

Verification

Confirm that the configuration is working properly.

Verifying the BFD Sessions

Purpose

Verify that the OSPF interfaces have active BFD sessions, and that session components have been configured correctly.

Action

From operational mode, enter the show bfd session detail command.

Meaning

The output displays information about the BFD sessions.

  • The Address field displays the IP address of the neighbor.

  • The Interface field displays the interface you configured for BFD.

  • The State field displays the state of the neighbor and should show Full to reflect the full neighbor adjacency that you configured.

  • The Transmit Interval field displays the time interval you configured to send BFD packets.

  • The Multiplier field displays the multiplier you configured.

Example: Configuring BFD for IS-IS

This example describes how to configure the Bidirectional Forwarding Detection (BFD) protocol to detect failures in an IS-IS network.

Note:

BFD is not supported with ISIS for IPV6 on QFX10000 series switches.

Requirements

Before you begin, configure IS-IS on both routers. See Example: Configuring IS-IS for information about the required IS-IS configuration.

Note:

We provide the IS-IS configuration in the CLI quick configuration section but do not cover the IS-IS configuration in the step-by-step.

This example uses the following hardware and software components:

  • Junos OS Release 7.3 or later

    • Updated and revalidated using Junos OS Release 22.4

  • M Series, MX Series, and T Series routers

Overview

This example shows two routers connected to each other. A loopback interface is configured on each router. IS-IS and BFD protocols are configured on both routers.

Topology

Figure 3 shows the sample network.

Figure 3: Configuring BFD for IS-ISConfiguring BFD for IS-IS

Configuration

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Router R1

Router R2

Procedure

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode.

Note:

To simply configure BFD for IS-IS, only the minimum-interval statement is required. The BFD protocol selects default parameters for all the other configuration statements when you use the bfd-liveness-detection statement without specifying any parameters.

Note:

You can change parameters at any time without stopping or restarting the existing session. BFD automatically adjusts to the new parameter value. However, no changes to BFD parameters take place until the values resynchronize with each BFD peer.

To configure BFD for IS-IS on Routers R1 and R2:

Note:

We are only showing the steps for R1.

  1. Configure the threshold for the adaptation of the detection time, which must be greater than the multiplier number multiplied by the minimum interval.

  2. Configure the minimum transmit and receive intervals for failure detection.

  3. Configure only the minimum receive interval for failure detection.

  4. Disable BFD adaptation.

  5. Configure the threshold for the transmit interval, which must be greater than the minimum transmit interval.

  6. Configure the minimum transmit interval for failure detection.

  7. Configure the multiplier number, which is the number of hello packets not received by the neighbor that causes the originating interface to be declared down.

  8. Configure the BFD version used for detection.

    The default is to have the version detected automatically.

Results

From configuration mode, confirm your configuration by issuing the show protocols isis interface command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

Verification

Confirm that the configuration is working properly.

Verifying the Connection Between Routers R1 and R2

Purpose

Make sure that Routers R1 and R2 can reach each other.

Action

Ping the other router to check the connectivity between the two routers as per the network topology.

Meaning

Routers R1 and R2 are able to ping each other.

Verifying That IS-IS Is Configured

Purpose

Make sure that the IS-IS instance is running on both routers.

Action

Use the show isis database statement to check if the IS-IS instance is running on both routers, R1 and R2.

Meaning

IS-IS is configured on both routers, R1 and R2.

Verifying That BFD Is configured

Purpose

Make sure that the BFD instance is running on both routers, R1 and R2.

Action

Use the show bfd session detail statement to check if BFD instance is running on the routers.

Meaning

BFD is configured on Routers R1 and R2 for detecting failures in the IS-IS network.

Example: Configuring BFD for RIP

This example shows how to configure Bidirectional Forwarding Detection (BFD) for a RIP network.

Requirements

No special configuration beyond device initialization is required before configuring this example.

Overview

To enable failure detection, include the bfd-liveness-detection statement:

Optionally, you can specify the threshold for the adaptation of the detection time by including the threshold statement. When the BFD session detection time adapts to a value equal to or greater than the threshold, a single trap and a system log message are sent.

To specify the minimum transmit and receive interval for failure detection, include the minimum-interval statement. This value represents the minimum interval at which the local routing device transmits hello packets as well as the minimum interval at which the routing device expects to receive a reply from a neighbor with which it has established a BFD session. You can configure a value in the range from 1 through 255,000 milliseconds. This examples sets a minimum interval of 600 milliseconds.

Note:

BFD is an intensive protocol that consumes system resources. Specifying a minimum interval for BFD of less than 100 ms for Routing Engine-based sessions and 10 ms for distributed BFD sessions can cause undesired BFD flapping.

Depending on your network environment, these additional recommendations might apply:

  • For large-scale network deployments with a large number of BFD sessions, specify a minimum interval of 300 ms for Routing Engine-based sessions and 100 ms for distributed BFD sessions.

  • For very large-scale network deployments with a large number of BFD sessions, contact Juniper Networks customer support for more information.

  • For BFD sessions to remain up during a Routing Engine switchover event when nonstop active routing (NSR) is configured, specify a minimum interval of 2500 ms for Routing Engine-based sessions. For distributed BFD sessions with nonstop active routing configured, the minimum interval recommendations are unchanged and depend only on your network deployment.

You can optionally specify the minimum transmit and receive intervals separately.

To specify only the minimum receive interval for failure detection, include the minimum-receive-interval statement. This value represents the minimum interval at which the local routing device expects to receive a reply from a neighbor with which it has established a BFD session. You can configure a value in the range from 1 through 255,00 milliseconds.

To specify only the minimum transmit interval for failure detection, include the transmit-interval minimum-interval statement. This value represents the minimum interval at which the local routing device transmits hello packets to the neighbor with which it has established a BFD session. You can configure a value in the range from 1 through 255,000 milliseconds.

To specify the number of hello packets not received by a neighbor that causes the originating interface to be declared down, include the multiplier statement. The default is 3, and you can configure a value in the range from 1 through 255.

To specify the threshold for detecting the adaptation of the transmit interval, include the transmit-interval threshold statement. The threshold value must be greater than the transmit interval.

To specify the BFD version used for detection, include the version statement. The default is to have the version detected automatically.

You can trace BFD operations by including the traceoptions statement at the [edit protocols bfd] hierarchy level.

In Junos OS Release 9.0 and later, you can configure BFD sessions not to adapt to changing network conditions. To disable BFD adaptation, include the no-adaptation statement. We recommend that you not disable BFD adaptation unless it is preferable not to have BFD adaptation enabled in your network.

Figure 4 shows the topology used in this example.

Figure 4: RIP BFD Network TopologyRIP BFD Network Topology

CLI Quick Configuration shows the configuration for all of the devices in Figure 4. The section Step-by-Step Procedure describes the steps on Device R1.

Topology

Configuration

Procedure

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Device R1

Device R2

Device R3

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure a BFD for a RIP network:

  1. Configure the network interfaces.

  2. Create the RIP group and add the interface.

    To configure RIP in Junos OS, you must configure a group that contains the interfaces on which RIP is enabled. You do not need to enable RIP on the loopback interface.

  3. Create the routing policy to advertise both direct and RIP-learned routes.

  4. Apply the routing policy.

    In Junos OS, you can only apply RIP export policies at the group level.

  5. Enable BFD.

  6. Configure tracing operations to track BFD messages.

Results

From configuration mode, confirm your configuration by entering the show interfaces, show protocols, and show policy-options commands. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

If you are done configuring the device, enter commit from configuration mode.

Verification

Confirm that the configuration is working properly.

Verifying That the BFD Sessions Are Up

Purpose

Make sure that the BFD sessions are operating.

Action

From operational mode, enter the show bfd session command.

Meaning

The output shows that there are no authentication failures.

Checking the BFD Trace File

Purpose

Use tracing operations to verify that BFD packets are being exchanged.

Action

From operational mode, enter the show log command.

Meaning

The output shows the normal functioning of BFD.

Configuring Micro BFD Sessions for LAG

The Bidirectional Forwarding Detection (BFD) protocol is a simple detection protocol that quickly detects failures in the forwarding paths. A link aggregation group (LAG) combines multiple links between devices that are in point-to-point connections, thereby increasing bandwidth, providing reliability, and allowing load balancing. To run a BFD session on LAG interfaces, configure an independent, asynchronous mode BFD session on every LAG member link in a LAG bundle. Instead of a single BFD session monitoring the status of the UDP port, independent micro BFD sessions monitor the status of individual member links.

Note:

Starting in Junos OS Evolved Release 20.1R1, independent micro Bidirectional Forwarding Detection (BFD) sessions are enabled on a per member link basis of a Link Aggregation Group (LAG) bundle.

To enable failure detection for aggregated Ethernet interfaces:

  1. Include the following statement in the configuration at the [edit interfaces aex aggregated-ether-options] hierarchy level:
  2. Configure the authentication criteria of the BFD session for LAG.

    To specify the authentication criteria, include the authentication statement:

    • Specify the algorithm to be used to authenticate the BFD session. You can use one of the following algorithms for authentication:

      • keyed-md5

      • keyed-sha-1

      • meticulous-keyed-md5

      • meticulous-keyed-sha-1

      • simple-password

    • To configure the key chain, specify the name that is associated with the security key for the BFD session. The name you specify must match one of the key chains configured in the authentication-key-chains key-chain statement at the [edit security] hierarchy level.

    • Configure loose authentication checking on the BFD session. Use only for transitional periods when authentication might not be configured at both ends of the BFD session.

  3. Configure BFD timers for aggregated Ethernet interfaces.

    To specify the BFD timers, include the detection-time statement:

    Specify the threshold value. This is the maximum time interval for detecting a BFD neighbor. If the transmit interval is greater than this value, the device triggers a trap.

  4. Configure a hold-down interval value to set the minimum time that the BFD session must remain up before a state change notification is sent to the other members in the LAG network.

    To specify the hold-down interval, include the holddown-interval statement:

    You can configure a number in the range from 0 through 255,000 milliseconds, and the default is 0. If the BFD session goes down and then comes back up during the hold-down interval, the timer is restarted.

    This value represents the minimum interval at which the local routing device transmits BFD packets, as well as the minimum interval in which the routing device expects to receive a reply from a neighbor with which it has established a BFD session. You can configure a number in the range from 1 through 255,000 milliseconds. You can also specify the minimum transmit and receive intervals separately.

  5. Configure the source address for the BFD session.

    To specify a local address, include the local-address statement:

    The BFD local address is the loopback address of the source of the BFD session.

    Note:

    Beginning with Junos OS Release 16.1, you can also configure this feature with the AE interface address as the local address in a micro BFD session. For the IPv6 address family, disable duplicate address detection before configuring this feature with the AE interface address. To disable duplicate address detection, include the dad-disable statement at the [edit interface aex unit y family inet6] hierarchy level.

    Beginning with Release 16.1R2, Junos OS checks and validates the configured micro BFD local-address against the interface or loopback IP address before the configuration commit. Junos OS performs this check on both IPv4 and IPv6 micro BFD address configurations, and if they do not match, the commit fails. The configured micro-BFD local-address should match with the micro-BFD neighbour-address configured on the peer router.

  6. Specify the minimum interval that indicates the time interval for transmitting and receiving data.

    This value represents the minimum interval at which the local routing device transmits BFD packets, as well as the minimum interval in which the routing device expects to receive a reply from a neighbor with which it has established a BFD session. You can configure a number in the range from 1 through 255,000 milliseconds. You can also specify the minimum transmit and receive intervals separately.

    To specify the minimum transmit and receive intervals for failure detection, include the minimum-interval statement:

    Note:

    BFD is an intensive protocol that consumes system resources. Specifying a minimum interval for BFD less than 100 ms for Routing Engine-based sessions and 10 ms for distributed BFD sessions can cause undesired BFD flapping.

    Depending on your network environment, these additional recommendations might apply:

    • For large-scale network deployments with a large number of BFD sessions, specify a minimum interval of 300 ms for Routing Engine-based sessions and 100 ms for distributed BFD sessions.

    • For very large-scale network deployments with a large number of BFD sessions, contact Juniper Networks customer support for more information.

    • For BFD sessions to remain up during a Routing Engine switchover event when nonstop active routing is configured, specify a minimum interval of 2500 ms for Routing Engine-based sessions. For distributed BFD sessions with nonstop active routing configured, the minimum interval recommendations are unchanged and depend only on your network deployment.

  7. Specify only the minimum receive interval for failure detection by including the minimum-receive-interval statement:

    This value represents the minimum interval in which the local routing device expects to receive a reply from a neighbor with which it has established a BFD session. You can configure a number in the range from 1 through 255,000 milliseconds.

  8. Specify the number of BFD packets that were not received by the neighbor that causes the originating interface to be declared down by including the multiplier statement:

    The default value is 3. You can configure a number in the range from 1 through 255.

  9. Configure the neighbor in a BFD session.

    The neighbor address can be either an IPv4 or an IPv6 address.

    To specify the next hop of the BFD session, include the neighbor statement:

    The BFD neighbor address is the loopback address of the remote destination of the BFD session.

    Note:

    Beginning with Junos OS Release 16.1, you can also configure the AE interface address of the remote destination as the BFD neighbor address in a micro BFD session.

  10. (Optional) Configure BFD sessions not to adapt to changing network conditions.

    To disable BFD adaptation, include the no-adaptation statement:

    Note:

    We recommend that you do not disable BFD adaptation unless it is preferable not to have BFD adaptation in your network.

  11. Specify a threshold for detecting the adaptation of the detection time by including the threshold statement:

    When the BFD session detection time adapts to a value equal to or greater than the threshold, a single trap and a system log message are sent. The detection time is based on the multiplier of the minimum-interval or the minimum-receive-interval value. The threshold must be a higher value than the multiplier for either of these configured values. For example, if the minimum-receive-interval is 300 ms and the multiplier is 3, the total detection time is 900 ms. Therefore, the detection time threshold must have a value greater than 900.

  12. Specify only the minimum transmit interval for failure detection by including the transmit-interval minimum-interval statement:

    This value represents the minimum interval at which the local routing device transmits BFD packets to the neighbor with which it has established a BFD session. You can configure a value in the range from 1 through 255,000 milliseconds.

  13. Specify the transmit threshold for detecting the adaptation of the transmit interval by including the transmit-interval threshold statement:

    The threshold value must be greater than the transmit interval. When the BFD session detection time adapts to a value greater than the threshold, a single trap and a system log message are sent. The detection time is based on the multiplier of the minimum-interval or the minimum-receive-interval value. The threshold must be a higher value than the multiplier for either of these configured values.

  14. Specify the BFD version by including the version statement:

    The default is to have the version detected automatically.

Note:
  • The version option is not supported on the QFX Series. Starting in Junos OS Release 17.2R1, a warning will appear if you attempt to use this command.

  • This feature works when both the devices support BFD. If BFD is configured at only one end of the LAG, this feature does not work.

Example: Configuring Independent Micro BFD Sessions for LAG

This example shows how to configure an independent micro BFD session for aggregated Ethernet interfaces.

Requirements

This example uses the following hardware and software components:

  • MX Series routers with Junos Trio chipset

  • T Series routers with Type 4 FPC or Type 5 FPC

    BFD for LAG is supported on the following PIC types on T-Series:

    • PC-1XGE-XENPAK (Type 3 FPC),

    • PD-4XGE-XFP (Type 4 FPC),

    • PD-5-10XGE-SFPP (Type 4 FPC),

    • 24x10GE (LAN/WAN) SFPP, 12x10GE (LAN/WAN) SFPP, 1X100GE Type 5 PICs

  • PTX Series routers with 24X10GE (LAN/WAN) SFPP

  • Junos OS Release 13.3 or later running on all devices

Overview

The example includes two routers that are directly connected. Configure two aggregated Ethernet interfaces, AE0 for IPv4 connectivity and AE1 for IPv6 connectivity. Configure micro BFD session on the AE0 bundle using IPv4 addresses as local and neighbor endpoints on both routers. Configure micro BFD session on the AE1 bundle using IPv6 addresses as local and neighbor endpoints on both routers. This example verifies that independent micro BFD sessions are active in the output.

Topology

Figure 5 shows the sample topology.

Figure 5: Configuring an Independent Micro BFD Session for LAGConfiguring an Independent Micro BFD Session for LAG

Configuration

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

Router R0

Router R1

Configuring a Micro BFD Session for Aggregated Ethernet Interfaces

Procedure

Step-by-Step Procedure

The following example requires that you navigate various levels in the configuration hierarchy. For information about navigating the CLI, see “Using the CLI Editor in Configuration Mode” in the CLI User Guide.

Note:

Repeat this procedure for Router R1, modifying the appropriate interface names, addresses, and any other parameters for each router.

To configure a micro BFD session for aggregated Ethernet interfaces on Router R0:

  1. Configure the physical interfaces.

  2. Configure the loopback interface.

  3. Configure an IP address on the aggregated Ethernet interface ae0 with either IPv4 or IPv6 addresses, as per your network requirements.

  4. Set the routing option, create a static route, and set the next-hop address.

    Note:

    You can configure either an IPv4 or IPv6 static route, depending on your network requirements.

  5. Configure the Link Aggregation Control Protocol (LACP).

  6. Configure BFD for the aggregated Ethernet interface ae0, and specify the minimum interval, local IP address, and the neighbor IP address.

  7. Configure an IP addresse on the aggregated Ethernet interface ae1.

    You can assign either IPv4 or IPv6 addresses as per your network requirements.

  8. Configure BFD for the aggregated Ethernet interface ae1.

    Note:

    Beginning with Junos OS Release 16.1, you can also configure this feature with the AE interface address as the local address in a micro BFD session.

    Beginning with Release 16.1R2, Junos OS checks and validates the configured micro BFD local-address against the interface or loopback IP address before the configuration commit. Junos OS performs this check on both IPv4 and IPv6 micro BFD address configurations, and if they do not match, the commit fails.

  9. Configure tracing options for BFD for troubleshooting.

Results

From configuration mode, enter the show interfaces, show protocols, and show routing-options commands and confirm your configuration. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

If you are done configuring the device, commit the configuration.

Verification

Confirm that the configuration is working properly.

Verifying That the Independent BFD Sessions Are Up

Purpose

Verify that the micro BFD sessions are up, and view details about the BFD sessions.

Action

From operational mode, enter the show bfd session extensive command.

Meaning

The Micro BFD field represents the independent micro BFD sessions running on the links in a LAG. The TX interval item, RX interval item output represents the setting configured with the minimum-interval statement. All of the other output represents the default settings for BFD. To modify the default settings, include the optional statements under bfd-liveness-detection statement.

Viewing Detailed BFD Events

Purpose

View the contents of the BFD trace file to assist in troubleshooting, if required.

Action

From operational mode, enter the file show /var/log/bfd command.

Meaning

BFD messages are being written to the specified trace file.

Configuring BFD for PIM

The Bidirectional Forwarding Detection (BFD) Protocol is a simple hello mechanism that detects failures in a network. BFD works with a wide variety of network environments and topologies. A pair of routing devices exchanges BFD packets. Hello packets are sent at a specified, regular interval. A neighbor failure is detected when the routing device stops receiving a reply after a specified interval. The BFD failure detection timers have shorter time limits than the Protocol Independent Multicast (PIM) hello hold time, so they provide faster detection.

The BFD failure detection timers are adaptive and can be adjusted to be faster or slower. The lower the BFD failure detection timer value, the faster the failure detection and vice versa. For example, the timers can adapt to a higher value if the adjacency fails (that is, the timer detects failures more slowly). Or a neighbor can negotiate a higher value for a timer than the configured value. The timers adapt to a higher value when a BFD session flap occurs more than three times in a span of 15 seconds. A back-off algorithm increases the receive (Rx) interval by two if the local BFD instance is the reason for the session flap. The transmission (Tx) interval is increased by two if the remote BFD instance is the reason for the session flap. You can use the clear bfd adaptation command to return BFD interval timers to their configured values. The clear bfd adaptation command is hitless, meaning that the command does not affect traffic flow on the routing device.

You must specify the minimum transmit and minimum receive intervals to enable BFD on PIM.

To enable failure detection:

  1. Configure the interface globally or in a routing instance.

    This example shows the global configuration.

  2. Configure the minimum transmit interval.

    This is the minimum interval after which the routing device transmits hello packets to a neighbor with which it has established a BFD session. Specifying an interval smaller than 300 ms can cause undesired BFD flapping.

  3. Configure the minimum interval after which the routing device expects to receive a reply from a neighbor with which it has established a BFD session.

    Specifying an interval smaller than 300 ms can cause undesired BFD flapping.

  4. (Optional) Configure other BFD settings.

    As an alternative to setting the receive and transmit intervals separately, configure one interval for both.

  5. Configure the threshold for the adaptation of the BFD session detection time.

    When the detection time adapts to a value equal to or greater than the threshold, a single trap and a single system log message are sent.

  6. Configure the number of hello packets not received by a neighbor that causes the originating interface to be declared down.
  7. Configure the BFD version.
  8. Specify that BFD sessions should not adapt to changing network conditions.

    We recommend that you not disable BFD adaptation unless it is preferable not to have BFD adaptation enabled in your network.

  9. Verify the configuration by checking the output of the show bfd session command.

Enabling Dedicated and Real-Time BFD on SRX Series Firewalls

By default, SRX Series Firewalls operate in centralized BFD mode. They also support distributed BFD, dedicated BFD, and real-time BFD.

Dedicated BFD

Enabling dedicated BFD impacts traffic throughput as one CPU core is removed from data plane processing.

To enable dedicated BFD on the SRX300, SRX320, SRX340, SRX345, SRX380, SRX1500, vSRX, and vSRX3.0 devices:

  1. Include the dedicated-ukern-cpu statement at the [edit chassis] hierarchy level and then commit the configuration.

    1. [edit]

    2. user@host# set chassis dedicated-ukern-cpu

      user@host# commit

      The following warning message to reboot the system displays when you commit the configuration:

      warning: Packet processing throughput may be impacted in dedicated-ukernel-cpu mode. warning: A reboot is required for dedicated-ukernel-cpu mode to be enabled. Please use "request system reboot" to reboot the system. commit complete

  2. Reboot the device to enable the configuration:

    1. user@host> request system reboot

  3. Verify that dedicated BFD is enabled.

    user@host> show chassis dedicated-ukern-cpu

    Dedicated Ukern CPU Status: Enabled

Real-Time BFD

Enabling real-time BFD does not impact data plane performance. Higher priority is given to the Packet Forwarding Engine process handling BFD in distributed mode. This is suitable for scenarios where less than half of the maximum number of BFD sessions are being used. See this list for the maximum number of BFD sessions supported per SRX device.

Note:

For more information about BFD in distributed mode, see Understanding How BFD Detects Network Failures.

To enable real-time BFD on SRX300, SRX320, SRX340, and SRX345 devices:

  1. Include the realtime-ukern-thread statement at the [edit chassis] hierarchy level and then commit the configuration.

    1. [edit]

    2. user@host# set chassis realtime-ukern-thread

      user@host# commit

      The following warning message to reboot the system displays when you commit the configuration:

      WARNING: realtime-ukern-thread is enable. Please use the command request system reboot.

  2. Reboot the device to enable the configuration:

    1. user@host> request system reboot

  3. Verify that real-time BFD is enabled.

    user@host> show chassis realtime-ukern-thread

    realtime Ukern thread Status: Enabled

BFD Support By SRX Platform

SRX Series Firewalls support the following maximum number of BFD sessions:

  • Up to four sessions on SRX300 and SRX320 devices.

  • Up to 50 sessions on SRX340, SRX345, and SRX380 devices.

  • Up to 120 sessions on SRX1500 devices.

On all SRX Series Firewalls, high CPU utilization triggered for reasons such as CPU intensive commands and SNMP walks causes the BFD protocol to flap while processing large BGP updates. (Platform support depends on the Junos OS release in your installation.)

SRX Series Firewalls operating in chassis cluster mode support only BFD centralized mode.

The table below shows the BFD modes supported on each SRX Series Firewall.

Table 1: BFD Modes Supported on SRX Series Firewalls

SRX Series Firewall

Centralized BFD Mode

Distributed BFD

Real-Time BFD

Dedicated Core

SRX300

Default

Configuration

Configuration (Optional)

Not supported

SRX320

Default

Configuration

Configuration (Optional)

Not supported

SRX340

Default

Configuration

Configuration

Configuration (Optional)

SRX345

Default

Configuration

Configuration

Configuration (Optional)

SRX380

Default

Configuration

Configuration

Configuration (Optional)

SRX1500 BFD failure detection time >= 500 ms and dedicated mode is not enabled BFD failure detection time < 500 ms and dedicated mode is not enabled Not supported Configuration
SRX4100 BFD failure detection time >= 500 ms BFD failure detection time < 500 ms Not supported Not supported
SRX4200 BFD failure detection time >= 500 ms BFD failure detection time < 500 ms Not supported Not supported
SRX4600 BFD failure detection time >= 500 ms BFD failure detection time < 500 ms Not supported Not supported

SRX5000 line of devices with SPC2 card

Default

Not supported

Not supported

Not supported

SRX5000 line of devices with SPC3 card

BFD failure detection time >= 500 ms

BFD failure detection time < 500 ms

Not supported

Not supported

vSRX 3.0

BFD failure detection time > 500ms

BFD failure detection time <= 500ms

Not supported

Configuration