Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


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

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


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


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 from the provider network to the customer network, using the next-hop address of You also configure a static default route of from the customer network to the provider network, using a next-hop address of

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



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


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.


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


Confirm that the configuration is working properly.

Verifying That BFD Sessions Are Up


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


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


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

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


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


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


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


BFD messages are being written to the trace file.