Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

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:

bfd-liveness-detection {detection-time {threshold milliseconds;}minimum-interval milliseconds;minimum-receive-interval milliseconds;multiplier number;no-adaptation;transmit-interval {threshold milliseconds;minimum-interval milliseconds;}version (1 | automatic);}

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 1 shows the topology used in this example.

Figure 1: RIP BFD Network Topology

RIP BFD Network Topology

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

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 R1

set interfaces fe-1/2/0 unit 1 family inet address 10.0.0.1/30set protocols bfd traceoptions file bfd-traceset protocols bfd traceoptions flag allset protocols rip group rip-group export advertise-routes-through-ripset protocols rip group rip-group neighbor fe-1/2/0.1set protocols rip group rip-group bfd-liveness-detection minimum-interval 600set policy-options policy-statement advertise-routes-through-rip term 1 from protocol directset policy-options policy-statement advertise-routes-through-rip term 1 from protocol ripset policy-options policy-statement advertise-routes-through-rip term 1 then accept

Device R2

set interfaces fe-1/2/0 unit 2 family inet address 10.0.0.2/30set interfaces fe-1/2/1 unit 5 family inet address 10.0.0.5/30set protocols rip group rip-group export advertise-routes-through-ripset protocols rip group rip-group neighbor fe-1/2/0.2set protocols rip group rip-group neighbor fe-1/2/1.5set protocols rip group rip-group bfd-liveness-detection minimum-interval 600set policy-options policy-statement advertise-routes-through-rip term 1 from protocol directset policy-options policy-statement advertise-routes-through-rip term 1 from protocol ripset policy-options policy-statement advertise-routes-through-rip term 1 then accept

Device R3

set interfaces fe-1/2/0 unit 6 family inet address 10.0.0.6/30set protocols rip group rip-group export advertise-routes-through-ripset protocols rip group rip-group neighbor fe-1/2/0.6set protocols rip group rip-group bfd-liveness-detection minimum-interval 600set policy-options policy-statement advertise-routes-through-rip term 1 from protocol directset policy-options policy-statement advertise-routes-through-rip term 1 from protocol ripset policy-options policy-statement advertise-routes-through-rip term 1 then accept

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.
    [edit interfaces]user@R1# set fe-1/2/0 unit 1 family inet address 10.0.0.1/30
  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.

    [edit protocols rip group rip-group]user@R1# set neighbor fe-1/2/0.1
  3. Create the routing policy to advertise both direct and RIP-learned routes.
    [edit policy-options policy-statement advertise-routes-through-rip term 1]user@R1# set from protocol directuser@R1# set from protocol ripuser@R1# set then accept
  4. Apply the routing policy.

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

    [edit protocols rip group rip-group]user@R1# set export advertise-routes-through-rip
  5. Enable BFD.
    [edit protocols rip group rip-group]user@R1# set bfd-liveness-detection minimum-interval 600
  6. Configure tracing operations to track BFD messages.
    [edit protocols bfd traceoptions]user@R1# set file bfd-traceuser@R1# set flag all

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.

user@R1# show interfaces
fe-1/2/0 {unit 1 {family inet {address 10.0.0.1/30;}}}
user@R1# show protocols
bfd {traceoptions {file bfd-trace;flag all;}}
rip {group rip-group {export advertise-routes-through-rip;bfd-liveness-detection {minimum-interval 600;}neighbor fe-1/2/0.1;}}
user@R1# show policy-options
policy-statement advertise-routes-through-rip {term 1 {from protocol [ direct rip ];then accept;}}

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.

                                                  Detect   Transmit
Address                  State     Interface      Time     Interval  Multiplier
10.0.0.2                 Up        fe-1/2/0.1     1.800     0.600        3   

1 sessions, 1 clients
Cumulative transmit rate 1.7 pps, cumulative receive rate 1.7 pps

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.

user@R1> show log bfd-trace
Feb 16 10:26:32 PPM Trace: BFD periodic xmit to 10.0.0.2 (IFL 124, rtbl 53, single-hop port)
Feb 16 10:26:32 Received Downstream TraceMsg (24) len 86:
Feb 16 10:26:32    IfIndex (3) len 4: 0
Feb 16 10:26:32    Protocol (1) len 1: BFD
Feb 16 10:26:32    Data (9) len 61: (hex) 42 46 44 20 70 61 63 6b 65 74 20 66 72 6f 6d 20 31 30 2e
Feb 16 10:26:32 PPM Trace: BFD packet from 10.0.0.1 (IFL 73, rtbl 56, ttl 255) absorbed
Feb 16 10:26:32 Received Downstream TraceMsg (24) len 60:
Feb 16 10:26:32    IfIndex (3) len 4: 0
Feb 16 10:26:32    Protocol (1) len 1: BFD
Feb 16 10:26:32    Data (9) len 35: (hex) 42 46 44 20 70 65 72 69 6f 64 69 63 20 78 6d 69 74 20 6f
...

Meaning

The output shows the normal functioning of BFD.

Published: 2013-04-01

Published: 2013-04-01