Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Example: Configuring EBGP Multihop Sessions on Logical Systems

This example shows how to configure an external BGP (EBGP) peer that is more than one hop away from the local router. This type of session is called a multihop EBGP session.

Requirements

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

Overview

When EBGP peers are not directly connected to each other, they must cross one or more non-BGP routers to reach each other. Configuring multihop EBGP enables the peers to pass through the other routers to form peer relationships and exchange update messages. This type of configuration is typically used when a Juniper Networks routing device needs to run EBGP with a third-party router that does not allow direct connection of the two EBGP peers. EBGP multihop enables a neighbor connection between two EBGP peers that do not have a direct connection.

The configuration to enable multihop EBGP sessions requires connectivity between the two EBGP peers. This example uses static routes to provide connectivity between the devices.

For directly connected EBGP sessions, physical addresses are typically used in the neighbor statements. For multihop EBGP, you must use loopback interface addresses, and specify the loopback interface address of the indirectly connected peer. In the use of loopback interfaces addresses, EBGP multihop is similar to internal BGP (IBGP).

Finally, you must add the multihop statement. Optionally, you can set a maximum time-to-live (TTL) value with the ttl statement. The TTL is carried in the IP header of BGP packets. If you do not specify a TTL value, the system’s default maximum TTL value is used. The default TTL value is 64 for multihop EBGP sessions. Another option is to retain the BGP next-hop value for route advertisements by including the no-nexthop-change statement.

Figure 1 shows a typical EBGP multihop network.

Device C and Device E have an established EBGP session. Device D is not a BGP-enabled device. All of the devices have connectivity via static routes.

Figure 1: Typical Network with EBGP Multihop Sessions

Typical Network with EBGP Multihop
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 C

set logical-systems C interfaces lt-1/2/0 unit 9 description to-Dset logical-systems C interfaces lt-1/2/0 unit 9 encapsulation ethernetset logical-systems C interfaces lt-1/2/0 unit 9 peer-unit 10set logical-systems C interfaces lt-1/2/0 unit 9 family inet address 10.10.10.9/30set logical-systems C interfaces lo0 unit 3 family inet address 192.168.40.4/32set logical-systems C protocols bgp group external-peers type externalset logical-systems C protocols bgp group external-peers multihop ttl 2set logical-systems C protocols bgp group external-peers local-address 192.168.40.4set logical-systems C protocols bgp group external-peers export send-staticset logical-systems C protocols bgp group external-peers peer-as 18set logical-systems C protocols bgp group external-peers neighbor 192.168.6.7set logical-systems C policy-options policy-statement send-static term 1 from protocol staticset logical-systems C policy-options policy-statement send-static term 1 then acceptset logical-systems C routing-options static route 10.10.10.14/32 next-hop 10.10.10.10set logical-systems C routing-options static route 192.168.6.7/32 next-hop 10.10.10.10set logical-systems C routing-options router-id 192.168.40.4set logical-systems C routing-options autonomous-system 17

Device D

set logical-systems D interfaces lt-1/2/0 unit 10 description to-Cset logical-systems D interfaces lt-1/2/0 unit 10 encapsulation ethernetset logical-systems D interfaces lt-1/2/0 unit 10 peer-unit 9set logical-systems D interfaces lt-1/2/0 unit 10 family inet address 10.10.10.10/30set logical-systems D interfaces lt-1/2/0 unit 13 description to-Eset logical-systems D interfaces lt-1/2/0 unit 13 encapsulation ethernetset logical-systems D interfaces lt-1/2/0 unit 13 peer-unit 14set logical-systems D interfaces lt-1/2/0 unit 13 family inet address 10.10.10.13/30set logical-systems D interfaces lo0 unit 4 family inet address 192.168.6.6/32set logical-systems D routing-options static route 192.168.40.4/32 next-hop 10.10.10.9set logical-systems D routing-options static route 192.168.6.7/32 next-hop 10.10.10.14set logical-systems D routing-options router-id 192.168.6.6

Device E

set logical-systems E interfaces lt-1/2/0 unit 14 description to-Dset logical-systems E interfaces lt-1/2/0 unit 14 encapsulation ethernetset logical-systems E interfaces lt-1/2/0 unit 14 peer-unit 13set logical-systems E interfaces lt-1/2/0 unit 14 family inet address 10.10.10.14/30set logical-systems E interfaces lo0 unit 5 family inet address 192.168.6.7/32set logical-systems E protocols bgp group external-peers multihop ttl 2set logical-systems E protocols bgp group external-peers local-address 192.168.6.7set logical-systems E protocols bgp group external-peers export send-staticset logical-systems E protocols bgp group external-peers peer-as 17set logical-systems E protocols bgp group external-peers neighbor 192.168.40.4set logical-systems E policy-options policy-statement send-static term 1 from protocol staticset logical-systems E policy-options policy-statement send-static term 1 then acceptset logical-systems E routing-options static route 10.10.10.8/30 next-hop 10.10.10.13set logical-systems E routing-options static route 192.168.40.4/32 next-hop 10.10.10.13set logical-systems E routing-options router-id 192.168.6.7set logical-systems E routing-options autonomous-system 18

Device C

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 Device C:

  1. Set the CLI to Logical System C.
    user@host> set cli logical-system C
  2. Configure the interface to the directly-connected device (to-D), and configure the loopback interface.
    [edit interfaces lt-1/2/0 unit 9]user@host:C# set description to-Duser@host:C# set encapsulation ethernetuser@host:C# set peer-unit 10user@host:C# set family inet address 10.10.10.9/30
    [edit interfaces lo0 unit 3]user@host:C# set family inet address 192.168.40.4/32
  3. Configure an EBGP session with Logical System E.

    The neighbor statement points to the loopback interface on Logical System E.

    [edit protocols bgp group external-peers]user@host:C# set type externaluser@host:C# set local-address 192.168.40.4user@host:C# set export send-staticuser@host:C# set peer-as 18user@host:C# set neighbor 192.168.6.7
  4. Configure the multihop statement to enable Logical System C and Logical System E to become EBGP peers.

    Because the peers are two hops away from each other, the example uses the ttl 2 statement.

    [edit protocols bgp group external-peers]user@host:C# set multihop ttl 2
  5. Configure connectivity to Logical System E, using static routes.

    You must configure a route to both the loopback interface address and to the address on the physical interface.

    [edit logical-systems C routing-options]user@host:C# set static route 10.10.10.14/32 next-hop 10.10.10.10user@host:C# set static route 192.168.6.7/32 next-hop 10.10.10.10
  6. Configure the local router ID and the autonomous system (AS) number.
    [edit routing-options]user@host:C# set router-id 192.168.40.4user@host:C# set autonomous-system 17
  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.

    [edit policy-options policy-statement send-static term 1]user@host:C# set from protocol staticuser@host:C# set then accept

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.

user@host:C# show interfaces
lt-1/2/0 {unit 9 {description to-D;encapsulation ethernet;peer-unit 10;family inet {address 10.10.10.9/30;}}}
lo0 {unit 3 {family inet {address 192.168.40.4/32;}}}
user@host:C# show protocols
bgp {group external-peers {type external;multihop {ttl 2;}local-address 192.168.40.4;export send-static;peer-as 18;neighbor 192.168.6.7;}}
user@host:C# show policy-options
policy-statement send-static {term 1 {from protocol static;then accept;}}
user@host:C# show routing-options
static {route 10.10.10.14/32 next-hop 10.10.10.10;route 192.168.6.7/32 next-hop 10.10.10.10;}
router-id 192.168.40.4;autonomous-system 17;

If you are done configuring the device, enter commit from configuration mode. Repeat these steps for all BFD sessions in the topology.

Device D

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 Device D:

  1. Set the CLI to Logical System D.
    user@host> set cli logical-system D
  2. Configure the interfaces to the directly-connected devices, and configure a loopback interface.
    [edit interfaces lt-1/2/0 unit 10]user@host:D# set description to-Cuser@host:D# set encapsulation ethernetuser@host:D# set peer-unit 9user@host:D# set family inet address 10.10.10.10/30
    [edit interfaces lt-1/2/0 unit 13]user@host:D# set description to-Euser@host:D# set encapsulation ethernetuser@host:D# set peer-unit 14user@host:D# set family inet address 10.10.10.13/30
    [edit interfaces lo0 unit 4]user@host:D# set family inet address 192.168.6.6/32
  3. Configure connectivity to the other devices using a static routes to the loopback interface addresses.

    On Logical System D, you do not need static routes to the physical addresses because Logical System D is directly connected to Logical System C and Logical System E.

    [edit routing-options]user@host:D# set static route 192.168.40.4/32 next-hop 10.10.10.9user@host:D# set static route 192.168.6.7/32 next-hop 10.10.10.14
  4. Configure the local router ID and the autonomous system (AS) number.
    [edit routing-options]user@host:D# set router-id 192.168.6.6

Results

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

user@host:D# show interfaces
lt-1/2/0 {unit 10 {description to-C;encapsulation ethernet;peer-unit 9;family inet {address 10.10.10.10/30;}}unit 13 {description to-E;encapsulation ethernet;peer-unit 14;family inet {address 10.10.10.13/30;}}}
lo0 {unit 4 {family inet {address 192.168.6.6/32;}}}
user@host:D# show protocols
user@host:D# show routing-options
static {route 192.168.40.4/32 next-hop 10.10.10.9;route 192.168.6.7/32 next-hop 10.10.10.14;}
router-id 192.168.6.6;

If you are done configuring the device, enter commit from configuration mode. Repeat these steps for all BFD sessions in the topology.

Device E

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 Device E:

  1. Set the CLI to Logical System E.
    user@host> set cli logical-system E
  2. Configure the interface to the directly-connected device (to-D), and configure the loopback interface.
    [edit interfaces lt-1/2/0 unit 14]user@host:E# set description to-Duser@host:E# set encapsulation ethernetuser@host:E# set peer-unit 13user@host:E# set family inet address 10.10.10.14/30
    [edit interfaces lo0 unit 5]user@host:E# set family inet address 192.168.6.7/32
  3. Configure an EBGP session with Logical System E.

    The neighbor statement points to the loopback interface on Logical System C.

    [edit protocols bgp group external-peers]user@host:E# set local-address 192.168.6.7user@host:E# set export send-staticuser@host:E# set peer-as 17user@host:E# set neighbor 192.168.40.4
  4. Configure the multihop statement to enable Logical System C and Logical System E to become EBGP peers.

    Because the peers are two hops away from each other, the example uses the ttl 2 statement.

    [edit protocols bgp group external-peers]user@host:E# set multihop ttl 2
  5. Configure connectivity to Logical System E, using static routes.

    You must configure a route to both the loopback interface address and to the address on the physical interface.

    [edit routing-options]user@host:E# set static route 10.10.10.8/30 next-hop 10.10.10.13user@host:E# set static route 192.168.40.4/32 next-hop 10.10.10.13
  6. Configure the local router ID and the autonomous system (AS) number.
    [edit routing-options]user@host:E# set router-id 192.168.6.7user@host:E# set autonomous-system 18
  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.

    [edit policy-options policy-statement send-static term 1]user@host:E# set from protocol staticuser@host:E# set send-static then accept

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.

user@host:E# show interfaces
lt-1/2/0 {unit 14 {description to-D;encapsulation ethernet;peer-unit 13;family inet {address 10.10.10.14/30;}}}
lo0 {unit 5 {family inet {address 192.168.6.7/32;}}}
user@host:E# show protocols
bgp {group external-peers {multihop {ttl 2;}local-address 192.168.6.7;export send-static;peer-as 17;neighbor 192.168.40.4;}}
user@host:E# show policy-options
policy-statement send-static {term 1 {from protocol static;then accept;}}
user@host:E# show routing-options
static {route 10.10.10.8/30 next-hop 10.10.10.13;route 192.168.40.4/32 next-hop 10.10.10.13;}
router-id 192.168.6.7;autonomous-system 18;

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

Verification

Confirm that the configuration is working properly.

Verifying Connectivity

Purpose

Make sure that Device C can ping Device E, specifying the loopback interface address as the source of the ping request.

The loopback interface address is the source address that BGP will be using.

Action

From operational mode, enter the ping 10.10.10.14 source 192.168.40.4 command from Logical System C, and enter the ping 10.10.10.9 source 192.168.6.7 command from Logical System E.

user@host:C> ping 10.10.10.14 source 192.168.40.4
PING 10.10.10.14 (10.10.10.14): 56 data bytes
64 bytes from 10.10.10.14: icmp_seq=0 ttl=63 time=1.262 ms
64 bytes from 10.10.10.14: icmp_seq=1 ttl=63 time=1.202 ms
^C
--- 10.10.10.14 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1.202/1.232/1.262/0.030 ms
user@host:E> ping 10.10.10.9 source 192.168.6.7
PING 10.10.10.9 (10.10.10.9): 56 data bytes
64 bytes from 10.10.10.9: icmp_seq=0 ttl=63 time=1.255 ms
64 bytes from 10.10.10.9: icmp_seq=1 ttl=63 time=1.158 ms
^C
--- 10.10.10.9 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1.158/1.206/1.255/0.049 ms

Meaning

The static routes are working if the pings work.

Verifying the BGP Sessions Are Established

Purpose

Verify that the BGP sessions are up.

Action

From operational mode, enter the show bgp summary command.

user@host:C> show bgp summary
Groups: 1 Peers: 1 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                 2          0          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
192.168.6.7              18        147        147       0       1     1:04:27 0/2/2/0              0/0/0/0
user@host:E> show bgp summary
Groups: 1 Peers: 1 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                 2          0          0          0          0          0
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
192.168.40.4             17        202        202       0       1     1:02:18 0/2/2/0              0/0/0/0

Meaning

The output shows that both devices have one peer each. No peers are down.

Viewing Advertised Routes

Purpose

Checking to make sure that routes are being advertised by BGP.

Action

From operational mode, enter the show route advertising-protocol bgp neighbor command.

user@host:C> show route advertising-protocol bgp 192.168.6.7
inet.0: 5 destinations, 7 routes (5 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 10.10.10.14/32          Self                                    I
* 192.168.6.7/32          Self                                    I
user@host:E> show route advertising-protocol bgp 192.168.40.4
inet.0: 5 destinations, 7 routes (5 active, 0 holddown, 0 hidden)
  Prefix                  Nexthop              MED     Lclpref    AS path
* 10.10.10.8/30           Self                                    I
* 192.168.40.4/32         Self                                    I

Meaning

The send-static routing policy is exporting the static routes from the routing table into BGP. BGP is advertising these routes between the peers because the BGP peer session is established.

Published: 2013-02-22