Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Example: Advertising Multiple Paths in BGP

 

In this example, BGP routers are configured to advertise multiple paths instead of advertising only the active path. Advertising multiple paths in BGP is specified in RFC 7911, Advertisement of Multiple Paths in BGP.

Requirements

This example uses the following hardware and software components:

  • Eight BGP-enabled devices.

  • Five of the BGP-enabled devices do not necessarily need to be routers. For example, they can be EX Series Ethernet Switches.

  • Three of the BGP-enabled devices are configured to send multiple paths or receive multiple paths (or both send and receive multiple paths). These three BGP-enabled devices must be M Series Multiservice Edge Routers, MX Series 5G Universal Routing Platforms, or T Series Core Routers.

  • The three routers must be running Junos OS Release 11.4 or later.

Overview

The following statements are used for configuring multiple paths to a destination:

In this example, Router R5, Router R6, and Router R7 redistribute static routes into BGP. Router R1 and Router R4 are route reflectors. Router R2 and Router R3 are clients to Route Reflector R1. Router R8 is a client to Route Reflector R4.

Route reflection is optional when multiple-path advertisement is enabled in BGP.

With the add-path send path-count 6 configuration, Router R1 is configured to send up to six paths (per destination) to Router R4.

With the add-path receive configuration, Router R4 is configured to receive multiple paths from Router R1.

With the add-path send path-count 6 configuration, Router R4 is configured to send up to six paths to Router R8.

With the add-path receive configuration, Router R8 is configured to receive multiple paths from Router R4.

The add-path send prefix-policy allow_199 policy configuration (along with the corresponding route filter) limits Router R4 to sending multiple paths for only the 172.16.199.1/32 route.

Topology Diagram

Figure 1 shows the topology used in this example.

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

Router R3

Router R4

Router R5

Router R6

Router R7

Router R8

Configuring Router R1

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 Router R1:

  1. Configure the interfaces to Router R2, Router R3, Router R4, and Router R5, and configure the loopback (lo0) interface.

  2. Configure BGP on the interfaces, and configure IBGP route reflection.

  3. Configure Router R1 to send up to six paths to its neighbor, Router R4.

    The destination of the paths can be any destination that Router R1 can reach through multiple paths.

  4. Configure OSPF on the interfaces.

  5. Configure the router ID and the autonomous system number.

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

Results

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

Configuring Router R2

Step-by-Step Procedure

To configure Router R2:

  1. Configure the loopback (lo0) interface and the interfaces to Router R6 and Router R1.

  2. Configure BGP and OSPF on Router R2’s interfaces.

  3. For routes sent from Router R2 to Router R1, advertise Router R2 as the next hop, because Router R1 does not have a route to Router R6’s address on the 10.0.26.0/24 network.

  4. Configure the autonomous system number.

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

Results

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

Configuring Router R3

Step-by-Step Procedure

To configure Router R3:

  1. Configure the loopback (lo0) interface and the interfaces to Router R7 and Router R1.

  2. Configure BGP and OSPF on Router R3’s interfaces.

  3. For routes sent from Router R3 to Router R1, advertise Router R3 as the next hop, because Router R1 does not have a route to Router R7’s address on the 10.0.37.0/24 network.

  4. Configure the autonomous system number.

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

Results

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

Configuring Router R4

Step-by-Step Procedure

To configure Router R4:

  1. Configure the interfaces to Router R1 and Router R8, and configure the loopback (lo0) interface.

  2. Configure BGP on the interfaces, and configure IBGP route reflection.

  3. Configure Router R4 to send up to six paths to its neighbor, Router R8.

    The destination of the paths can be any destination that Router R4 can reach through multiple paths.

  4. Configure Router R4 to receive multiple paths from its neighbor, Router R1.

    The destination of the paths can be any destination that Router R1 can reach through multiple paths.

  5. Configure OSPF on the interfaces.

  6. Configure a policy that allows Router R4 to send Router R8 multiple paths to the 172.16.199.1/32 route.
    • Router R4 receives multiple paths for the 172.16.198.1/32 route and the 172.16.199.1/32 route. However, because of this policy, Router R4 only sends multiple paths for the 172.16.199.1/32 route.

    • Router R4 can also be configured to send up-to 20 BGP add-path routes for a subset of add-path advertised prefixes.

  7. Configure the autonomous system number.

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

Results

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

Configuring Router R5

Step-by-Step Procedure

To configure Router R5:

  1. Configure the loopback (lo0) interface and the interface to Router R1.

  2. Configure BGP on Router R5’s interface.

  3. Create static routes for redistribution into BGP.

  4. Redistribute static and direct routes into BGP.

  5. Configure the autonomous system number.

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

Results

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

Configuring Router R6

Step-by-Step Procedure

To configure Router R6:

  1. Configure the loopback (lo0) interface and the interface to Router R2.

  2. Configure BGP on Router R6’s interface.

  3. Create static routes for redistribution into BGP.

  4. Redistribute static and direct routes from Router R6’s routing table into BGP.

  5. Configure the autonomous system number.

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

Results

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

Configuring Router R7

Step-by-Step Procedure

To configure Router R7:

  1. Configure the loopback (lo0) interface and the interface to Router R3.

  2. Configure BGP on Router R7’s interface.

  3. Create a static route for redistribution into BGP.

  4. Redistribute static and direct routes from Router R7’s routing table into BGP.

  5. Configure the autonomous system number.

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

Results

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

Configuring Router R8

Step-by-Step Procedure

To configure Router R8:

  1. Configure the loopback (lo0) interface and the interface to Router R4.

  2. Configure BGP and OSPF on Router R8’s interface.

  3. Configure Router R8 to receive multiple paths from its neighbor, Router R4.

    The destination of the paths can be any destination that Router R4 can reach through multiple paths.

  4. Configure the autonomous system number.

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

Results

From configuration mode, confirm your configuration by entering the show interfaces, show protocols, show policy-options, 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 the BGP Peers Have the Ability to Send and Receive Multiple Paths

Purpose

Make sure that one or both of the following strings appear in the output of the show bgp neighbor command:

  • NLRI's for which peer can receive multiple paths: inet-unicast

  • NLRI's for which peer can send multiple paths: inet-unicast

Action

user@R1> show bgp neighbor 10.0.0.40
user@R4> show bgp neighbor 10.0.0.10
user@R4> show bgp neighbor 10.0.0.80
user@R8> show bgp neighbor 10.0.0.40

Verifying That Router R1 Is Advertising Multiple Paths

Purpose

Make sure that multiple paths to the 172.16.198.1/32 destination and multiple paths to the 172.16.199.1/32 destination are advertised to Router R4.

Action

user@R1> show route advertising-protocol bgp 10.0.0.40

Meaning

When you see one prefix and more than one next hop, it means that multiple paths are advertised to Router R4.

Verifying That Router R4 Is Receiving and Advertising Multiple Paths

Purpose

Make sure that multiple paths to the 172.16.199.1/32 destination are received from Router R1 and advertised to Router R8. Make sure that multiple paths to the 172.16.198.1/32 destination are received from Router R1, but only one path to this destination is advertised to Router R8.

Action

user@R4> show route receive-protocol bgp 10.0.0.10
user@R4> show route advertising-protocol bgp 10.0.0.80

Meaning

The show route receive-protocol command shows that Router R4 receives two paths to the 172.16.198.1/32 destination and three paths to the 172.16.199.1/32 destination. The show route advertising-protocol command shows that Router R4 advertises only one path to the 172.16.198.1/32 destination and advertises all three paths to the 172.16.199.1/32 destination.

Because of the prefix policy that is applied to Router R4, Router R4 does not advertise multiple paths to the 172.16.198.1/32 destination. Router R4 advertises only one path to the 172.16.198.1/32 destination even though it receives multiple paths to this destination.

Verifying That Router R8 Is Receiving Multiple Paths

Purpose

Make sure that Router R8 receives multiple paths to the 172.16.199.1/32 destination through Router R4. Make sure that Router R8 receives only one path to the 172.16.198.1/32 destination through Router R4.

Action

user@R8> show route receive-protocol bgp 10.0.0.40

Checking the Path ID

Purpose

On the downstream devices, Router R4 and Router R8, verify that a path ID uniquely identifies the path. Look for the Addpath Path ID: string.

Action

user@R4> show route 172.16.199.1/32 detail
user@R8> show route 172.16.199.1/32 detail