Cisco device configuration tutorials and networking fundamentals

Cisco configuration tutorials

Archive

BGP Multipath Configuration - eBGP and iBGP - IPv4 and IPv6

«    2024 Nov 26    »

What is BGP Multipath?

With BGP multipath a router selects a single best-path to a destination prefix and additionally considers one or more equal cost paths to install in the RIB/FIB. If there are multiple equal cost iBGP or eBGP paths to a destination, a router enabled with multipath can install those paths from the BGP table into the IP routing table. There are several details to consider when enabling BGP multipath.

The example BGP router configuration command maximum-paths 2 enables multipath for two eBGP prefixes. If multipath for iBGP is needed the example command maximum-paths ibgp 2 can be used. The feature can also be configured for both eBGP and iBGP but needs to be used with caution, as reminded in the following output. Also, the outputs show the different multipath commands may be mutually exclusive.

R1>
R1>enable
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#
R1(config)#router bgp 65100
R1(config-router)#address-family ipv4
R1(config-router-af)#maximum-paths eibgp 2
%BGP: This may cause traffic loop if not used properly (command accepted)

------------

R1(config-router-af)#maximum-paths eibgp 2
% De-configure  ibgp-multipath first

------------

R1(config-router-af)#maximum-paths eibgp 2  
% De-configure ebgp-multipath  first

Two eBGP paths - same AS

In the following scenario, R1 installs two equal cost routes through the AS 65100 and destined to the prefix 172.16.2.0/24 in Site 2. This is accomplished with eBGP multipath configured on R1. Notice that 4-byte BGP AS Numbers are used, and on R1 the neighbor configuration is applied with a peer-session template. The BGP router command maximum-paths 2 ensures that two paths are installed into the RIB.

External BGP multipath maximum-paths configuration

Configuration:

R1
    R1#show run | sec ^router
    router bgp 64086.59904
     template peer-session EXAMPLE-SESSION
      remote-as 65100
     exit-peer-session
     !
     bgp router-id 1.1.1.1
     bgp asnotation dot
     bgp log-neighbor-changes
     neighbor 10.1.0.2 inherit peer-session EXAMPLE-SESSION
     neighbor 10.2.0.2 inherit peer-session EXAMPLE-SESSION
     !
     address-family ipv4
      network 172.16.1.0 mask 255.255.255.0
      neighbor 10.1.0.2 activate
      neighbor 10.2.0.2 activate
      maximum-paths 2
     exit-address-family
    
    R1#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to Host **
     ip address 172.16.1.2 255.255.255.0
     duplex auto
     speed auto
     media-type rj45
    
    R1#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R2 **
     ip address 10.1.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R1#show run int Gi0/2 | sec int
    interface GigabitEthernet0/2
     description ** to R3 **
     ip address 10.2.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
R2
    R2#show run | sec ^router
    router bgp 65100
     bgp router-id 2.2.2.2
     bgp asnotation dot
     bgp log-neighbor-changes
     neighbor 10.1.0.1 remote-as 64086.59904
     neighbor 10.3.0.1 remote-as 64086.59905
    
    R2#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R1 **
     ip address 10.1.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R2#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R4 **
     ip address 10.3.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
R3
    R3#show run | sec ^router
    router bgp 65100
     bgp router-id 3.3.3.3
     bgp asnotation dot
     bgp log-neighbor-changes
     neighbor 10.2.0.1 remote-as 64086.59904
     neighbor 10.4.0.1 remote-as 64086.59905
    
    R3#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R1 **
     ip address 10.2.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R3#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R4 **
     ip address 10.4.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
R4
    R4#show run | sec ^router
    router bgp 64086.59905
     bgp router-id 4.4.4.4
     bgp asnotation dot
     bgp log-neighbor-changes
     neighbor 10.3.0.2 remote-as 65100
     neighbor 10.4.0.2 remote-as 65100
     !
     address-family ipv4
      network 172.16.2.0 mask 255.255.255.0
      neighbor 10.3.0.2 activate
      neighbor 10.4.0.2 activate
     exit-address-family
    
    R4#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to Server **
     ip address 172.16.2.2 255.255.255.0
     duplex auto
     speed auto
     media-type rj45
    
    R4#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R2 **
     ip address 10.3.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R4#show run int Gi0/2 | sec int
    interface GigabitEthernet0/2
     description ** to R3 **
     ip address 10.4.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
R1#show ip bgp | beg Ne
     Network          Next Hop            Metric LocPrf Weight Path
 *>   172.16.1.0/24    0.0.0.0                  0         32768 i
 *m   172.16.2.0/24    10.2.0.2                               0 65100 64086.59905 i      « Multipath route in BGP Table (BGP RIB)
 *>                    10.1.0.2                               0 65100 64086.59905 i




R1#show ip route bgp | beg Ga 
Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
B        172.16.2.0/24 [20/0] via 10.2.0.2, 00:57:16                                     « Two BGP routes to single destination
                       [20/0] via 10.1.0.2, 00:57:16
					   
					   
					  		   
					   
R1#show ip bgp 172.16.2.0
BGP routing table entry for 172.16.2.0/24, version 3
Paths: (2 available, best #2, table default)
Multipath: eBGP
  Advertised to update-groups:
     1         
  Refresh Epoch 1
  65100 64086.59905
    10.2.0.2 from 10.2.0.2 (3.3.3.3)
      Origin IGP, localpref 100, valid, external, multipath(oldest)                      « Multipath routes to single destination
      rx pathid: 0, tx pathid: 0
  Refresh Epoch 1
  65100 64086.59905
    10.1.0.2 from 10.1.0.2 (2.2.2.2)
      Origin IGP, localpref 100, valid, external, multipath, best
      rx pathid: 0, tx pathid: 0x0





R1#show ip bgp 172.16.2.0 bestpath                              « BGP still selects a best path even if multipath is enabled                  
BGP routing table entry for 172.16.2.0/24, version 3
Paths: (2 available, best #2, table default)
Multipath: eBGP
  Advertised to update-groups:
     1         
  Refresh Epoch 1
  65100 64086.59905
    10.1.0.2 from 10.1.0.2 (2.2.2.2)
      Origin IGP, localpref 100, valid, external, multipath, best
      rx pathid: 0, tx pathid: 0x0
	  
	  


R1#show ip cef exact-route 172.16.1.1 172.16.2.1
172.16.1.1 -> 172.16.2.1 =>IP adj out of GigabitEthernet0/1, addr 10.1.0.2        « Equal cost load sharing, from one host transmit through R2




R1#show ip cef exact-route 172.16.1.3 172.16.2.1
172.16.1.3 -> 172.16.2.1 =>IP adj out of GigabitEthernet0/2, addr 10.2.0.2        « From another host transmit through R3




R1#show ip cef 172.16.2.0 detail
172.16.2.0/24, epoch 0, flags [rib only nolabel, rib defined all labels], per-destination sharing
  recursive via 10.1.0.2
    attached to GigabitEthernet0/1
  recursive via 10.2.0.2
    attached to GigabitEthernet0/2

Three eBGP paths - same AS (IPv6)

In the following example, eBGP multipath installs 3 routes received from AS 65100 and destined to the IPv6 network 2001:DB8:B::/64. This means, that the BGP router command maximum-paths 3 is configured on R1 under the IPv6 address-family section. Notice that a BGP Dynamic Neighbor configuration is also applied on R1 for IPv6 peerings.

Multiprotocol BGP multipath for IPv6 address-family

Configuration:

R1
    R1#show run | sec ^router
    router bgp 65001
     bgp router-id 1.1.1.1
     bgp log-neighbor-changes
     bgp listen range 2001:DB8::/32 peer-group EXAMPLE-PG
     neighbor EXAMPLE-PG peer-group
     neighbor EXAMPLE-PG remote-as 65100
     !
     address-family ipv4
      no neighbor EXAMPLE-PG activate
     exit-address-family
     !
     address-family ipv6
      maximum-paths 3
      network 2001:DB8:A::/64
      neighbor EXAMPLE-PG activate
     exit-address-family
    
    R1#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to Host **
     no ip address
     duplex auto
     speed auto
     media-type rj45
     ipv6 address FE80::2 link-local
     ipv6 address 2001:DB8:A::2/64
    
    R1#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R2 **
     no ip address
     duplex auto
     speed auto
     media-type rj45
     ipv6 address FE80::1 link-local
     ipv6 address 2001:DB8:1::1/64
    
    R1#show run int Gi0/2 | sec int
    interface GigabitEthernet0/2
     description ** to R3 **
     no ip address
     duplex auto
     speed auto
     media-type rj45
     ipv6 address FE80::1 link-local
     ipv6 address 2001:DB8:2::1/64
    
    R1#show run int Gi0/3 | sec int
    interface GigabitEthernet0/3
     description ** to R4 **
     no ip address
     duplex auto
     speed auto
     media-type rj45
     ipv6 address FE80::1 link-local
     ipv6 address 2001:DB8:3::1/64
    
    R1#show run | sec ^ipv6 unicast
    ipv6 unicast-routing
    
R2
    R2#show run | sec ^router
    router bgp 65100
     bgp router-id 2.2.2.2
     bgp log-neighbor-changes
     neighbor 2001:DB8:1::1 remote-as 65001
     neighbor 2001:DB8:4::1 remote-as 65002
     !
     address-family ipv4
      no neighbor 2001:DB8:1::1 activate
      no neighbor 2001:DB8:4::1 activate
     exit-address-family
     !
     address-family ipv6
      neighbor 2001:DB8:1::1 activate
      neighbor 2001:DB8:4::1 activate
     exit-address-family
    
    R2#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R1 **
     no ip address
     duplex auto
     speed auto
     media-type rj45
     ipv6 address FE80::2 link-local
     ipv6 address 2001:DB8:1::2/64
    
    R2#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R5 **
     no ip address
     duplex auto
     speed auto
     media-type rj45
     ipv6 address FE80::2 link-local
     ipv6 address 2001:DB8:4::2/64
    
    R2#show run | sec ^ipv6 unicast
    ipv6 unicast-routing
    
R3
    R3#show run | sec ^router
    router bgp 65100
     bgp router-id 3.3.3.3
     bgp log-neighbor-changes
     neighbor 2001:DB8:2::1 remote-as 65001
     neighbor 2001:DB8:5::1 remote-as 65002
     !
     address-family ipv4
      no neighbor 2001:DB8:2::1 activate
      no neighbor 2001:DB8:5::1 activate
     exit-address-family
     !
     address-family ipv6
      neighbor 2001:DB8:2::1 activate
      neighbor 2001:DB8:5::1 activate
     exit-address-family
    
    R3#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R1 **
     no ip address
     duplex auto
     speed auto
     media-type rj45
     ipv6 address FE80::2 link-local
     ipv6 address 2001:DB8:2::2/64
    
    R3#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R5 **
     no ip address
     duplex auto
     speed auto
     media-type rj45
     ipv6 address FE80::2 link-local
     ipv6 address 2001:DB8:5::2/64
    
    R3#show run | sec ^ipv6 unicast
    ipv6 unicast-routing
    
R5
    R5#show run | sec ^router
    router bgp 65002
     bgp router-id 5.5.5.5
     bgp log-neighbor-changes
     neighbor 2001:DB8:4::2 remote-as 65100
     neighbor 2001:DB8:5::2 remote-as 65100
     neighbor 2001:DB8:6::2 remote-as 65100
     !
     address-family ipv4
      no neighbor 2001:DB8:4::2 activate
      no neighbor 2001:DB8:5::2 activate
      no neighbor 2001:DB8:6::2 activate
     exit-address-family
     !
     address-family ipv6
      network 2001:DB8:B::/64
      neighbor 2001:DB8:4::2 activate
      neighbor 2001:DB8:5::2 activate
      neighbor 2001:DB8:6::2 activate
     exit-address-family
    
    R5#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to Server **
     no ip address
     duplex auto
     speed auto
     media-type rj45
     ipv6 address FE80::2 link-local
     ipv6 address 2001:DB8:B::2/64
    
    R5#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R2 **
     no ip address
     duplex auto
     speed auto
     media-type rj45
     ipv6 address FE80::1 link-local
     ipv6 address 2001:DB8:4::1/64
    
    R5#show run int Gi0/2 | sec int
    interface GigabitEthernet0/2
     description ** to R3 **
     no ip address
     duplex auto
     speed auto
     media-type rj45
     ipv6 address FE80::1 link-local
     ipv6 address 2001:DB8:5::1/64
    
    R5#show run int Gi0/3 | sec int
    interface GigabitEthernet0/3
     description ** to R4 **
     no ip address
     duplex auto
     speed auto
     media-type rj45
     ipv6 address FE80::1 link-local
     ipv6 address 2001:DB8:6::1/64
    
    R5#show run | sec ^ipv6 unicast
    ipv6 unicast-routing
    
R1#show ip bgp ipv6 unicast | beg Ne        
     Network          Next Hop            Metric LocPrf Weight Path
 *>   2001:DB8:A::/64  ::                       0         32768 i
 *m   2001:DB8:B::/64  2001:DB8:1::2                          0 65100 65002 i        « Multipath IPv6 NLRI in BGP table
 *m                    2001:DB8:3::2                          0 65100 65002 i
 *>                    2001:DB8:2::2                          0 65100 65002 i




R1#show ip bgp ipv6 unicast summary | beg Ne
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
*2001:DB8:1::2  4        65100     116     117        5    0    0 01:38:42        1
*2001:DB8:2::2  4        65100     116     112        5    0    0 01:38:49        1
*2001:DB8:3::2  4        65100     116     115        5    0    0 01:38:46        1
* Dynamically created based on a listen range command
Dynamically created neighbors: 3, Subnet ranges: 1                                   « IPv6 Dynamic Neighbors established

BGP peergroup EXAMPLE-PG listen range group members: 
  2001:DB8::/32 

Total dynamically created neighbors: 3/(100 max), Subnet ranges: 1




R1#show ip bgp ipv6 unicast 2001:DB8:B::/64
BGP routing table entry for 2001:DB8:B::/64, version 5
Paths: (3 available, best #3, table default)
Multipath: eBGP
Flag: 0x8000000100
  Advertised to update-groups:
     1         
  Refresh Epoch 2
  65100 65002
    2001:DB8:1::2 (FE80::2) from *2001:DB8:1::2 (2.2.2.2)                            « IPv6 BGP routes have Global and Link-local next-hop
      Origin IGP, localpref 100, valid, external, multipath
      rx pathid: 0, tx pathid: 0
  Refresh Epoch 2
  65100 65002
    2001:DB8:3::2 (FE80::2) from *2001:DB8:3::2 (4.4.4.4)
      Origin IGP, localpref 100, valid, external, multipath(oldest)
      rx pathid: 0, tx pathid: 0
  Refresh Epoch 2
  65100 65002
    2001:DB8:2::2 (FE80::2) from *2001:DB8:2::2 (3.3.3.3)
      Origin IGP, localpref 100, valid, external, multipath, best
      rx pathid: 0, tx pathid: 0x0




R1#show ipv6 route bgp
IPv6 Routing Table - default - 10 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
       B - BGP, HA - Home Agent, MR - Mobile Router, R - RIP
       H - NHRP, I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea
       IS - ISIS summary, D - EIGRP, EX - EIGRP external, NM - NEMO
       ND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - Redirect
       RL - RPL, O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1
       OE2 - OSPF ext 2, ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
       la - LISP alt, lr - LISP site-registrations, ld - LISP dyn-eid
       lA - LISP away, a - Application
B   2001:DB8:B::/64 [20/0]                                    « Single prefix has three next-hop addresses in IPv6 RIB
     via FE80::2, GigabitEthernet0/2
     via FE80::2, GigabitEthernet0/3
     via FE80::2, GigabitEthernet0/1

Two eBGP paths - different AS

In the following scenario, eBGP on R1 receives multiple equal cost paths but from different ASN neighbors. Namely, R1 peers with R2 (AS 65100) and R3 (AS 65200). On R1, the BGP router command bgp bestpath as-path multipath-relax allows the use of two routes with different AS-Path next-hops to be considered for multipath.

BGP multipath from different AS with multipath-relax keyword

Configuration:

R1
    R1#show run | sec ^router
    router bgp 65001
     bgp router-id 1.1.1.1
     bgp log-neighbor-changes
     bgp bestpath as-path multipath-relax
     neighbor 10.1.0.2 remote-as 65100
     neighbor 10.2.0.2 remote-as 65200
     !
     address-family ipv4
      network 172.16.1.0 mask 255.255.255.0
      neighbor 10.1.0.2 activate
      neighbor 10.2.0.2 activate
      maximum-paths 2
     exit-address-family
    
    R1#show run int Gi1 | sec int 
    interface GigabitEthernet1
     description ** to Host **
     ip address 172.16.1.2 255.255.255.0
     negotiation auto
     no mop enabled
     no mop sysid
    
    R1#show run int Gi2 | sec int
    interface GigabitEthernet2
     description ** to R2 **
     ip address 10.1.0.1 255.255.255.252
     negotiation auto
     no mop enabled
     no mop sysid
    
    R1#show run int Gi3 | sec int
    interface GigabitEthernet3
     description ** to R3 **
     ip address 10.2.0.1 255.255.255.252
     negotiation auto
     no mop enabled
     no mop sysid
    
R2
    R2#show run | sec ^router
    router bgp 65100
     bgp router-id 2.2.2.2
     bgp log-neighbor-changes
     neighbor 10.1.0.1 remote-as 65001
     neighbor 10.3.0.1 remote-as 65002
     !
     address-family ipv4
      neighbor 10.1.0.1 activate
      neighbor 10.3.0.1 activate
     exit-address-family
    
    R2#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R1 **
     ip address 10.1.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R2#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R4 **
     ip address 10.3.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
R3
    R3#show run | sec ^router
    router bgp 65200
     bgp router-id 3.3.3.3
     bgp log-neighbor-changes
     neighbor 10.2.0.1 remote-as 65001
     neighbor 10.4.0.1 remote-as 65002
     !
     address-family ipv4
      neighbor 10.2.0.1 activate
      neighbor 10.4.0.1 activate
     exit-address-family
    
    R3#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R1 **
     ip address 10.2.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R3#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R4 **
     ip address 10.4.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
R4
    R4#show run | sec ^router
    router bgp 65002
     bgp router-id 4.4.4.4
     bgp log-neighbor-changes
     neighbor 10.3.0.2 remote-as 65100
     neighbor 10.4.0.2 remote-as 65200
     !
     address-family ipv4
      network 172.16.2.0 mask 255.255.255.0
      neighbor 10.3.0.2 activate
      neighbor 10.4.0.2 activate
     exit-address-family
    
    R4#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to Server **
     ip address 172.16.2.2 255.255.255.0
     duplex auto
     speed auto
     media-type rj45
    
    R4#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R2 **
     ip address 10.3.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R4#show run int Gi0/2 | sec int
    interface GigabitEthernet0/2
     description ** to R3 **
     ip address 10.4.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
R1#show ip bgp | beg Ne
     Network          Next Hop            Metric LocPrf Weight Path
 *>   172.16.1.0/24    0.0.0.0                  0         32768 i
 *m   172.16.2.0/24    10.2.0.2                               0 65200 65002 i           « Next-hop selected for multipath
 *>                    10.1.0.2                               0 65100 65002 i




R1#show ip bgp 172.16.2.0
BGP routing table entry for 172.16.2.0/24, version 11
Paths: (2 available, best #2, table default)
Multipath: eBGP
  Advertised to update-groups:
     1         
  Refresh Epoch 2
  65200 65002                                                                           « Multipath routes with different neighbor AS
    10.2.0.2 from 10.2.0.2 (3.3.3.3)
      Origin IGP, localpref 100, valid, external, multipath(oldest)
      rx pathid: 0, tx pathid: 0
      Updated on Nov 28 2024 18:24:32 UTC
  Refresh Epoch 2
  65100 65002
    10.1.0.2 from 10.1.0.2 (2.2.2.2)
      Origin IGP, localpref 100, valid, external, multipath, best
      rx pathid: 0, tx pathid: 0x0
      Updated on Nov 28 2024 18:24:25 UTC





R1#show ip route bgp | beg Ga
Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
B        172.16.2.0/24 [20/0] via 10.2.0.2, 00:14:32                                    « Multipath installed in IP RIB
                       [20/0] via 10.1.0.2, 00:14:32

Two iBGP paths

In the following example, iBGP multipath is configured with the command maximum-paths ibgp 2 on R1. This means, R1 installs two next-hop addresses received through internal BGP from R2 and R3. The next-hop addresses are for the single destination prefix 172.16.2.0/24 in Site 2.

Internal BGP multipath

Configuration:

R1
    R1#show run | sec ^router
    router bgp 65001
     bgp router-id 1.1.1.1
     bgp log-neighbor-changes
     neighbor 10.1.0.2 remote-as 65001
     neighbor 10.2.0.2 remote-as 65001
     !
     address-family ipv4
      network 172.16.1.0 mask 255.255.255.0
      neighbor 10.1.0.2 activate
      neighbor 10.2.0.2 activate
      maximum-paths ibgp 2
     exit-address-family
    
    R1#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to Host **
     ip address 172.16.1.2 255.255.255.0
     duplex auto
     speed auto
     media-type rj45
    
    R1#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R2 **
     ip address 10.1.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R1#show run int Gi0/2 | sec int
    interface GigabitEthernet0/2
     description ** to R3 **
     ip address 10.2.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
R2
    R2#show run | sec ^router
    router bgp 65001
     bgp router-id 2.2.2.2
     bgp log-neighbor-changes
     neighbor 10.1.0.1 remote-as 65001
     neighbor 10.3.0.1 remote-as 65002
     !
     address-family ipv4
      neighbor 10.1.0.1 activate
      neighbor 10.1.0.1 next-hop-self
      neighbor 10.3.0.1 activate
     exit-address-family
    
    R2#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R1 **
     ip address 10.1.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R2#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R4 **
     ip address 10.3.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
R3
    R3#show run | sec ^router
    router bgp 65001
     bgp router-id 3.3.3.3
     bgp log-neighbor-changes
     neighbor 10.2.0.1 remote-as 65001
     neighbor 10.4.0.1 remote-as 65002
     !
     address-family ipv4
      neighbor 10.2.0.1 activate
      neighbor 10.2.0.1 next-hop-self
      neighbor 10.4.0.1 activate
     exit-address-family
    
    R3#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R1 **
     ip address 10.2.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R3#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R4 **
     ip address 10.4.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
R4
    R4#show run | sec ^router
    router bgp 65002
     bgp router-id 4.4.4.4
     bgp log-neighbor-changes
     neighbor 10.3.0.2 remote-as 65001
     neighbor 10.4.0.2 remote-as 65001
     !
     address-family ipv4
      network 172.16.2.0 mask 255.255.255.0
      neighbor 10.3.0.2 activate
      neighbor 10.4.0.2 activate
     exit-address-family
    
    R4#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to Server **
     ip address 172.16.2.2 255.255.255.0
     duplex auto
     speed auto
     media-type rj45
    
    R4#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R2 **
     ip address 10.3.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R4#show run int Gi0/2 | sec int
    interface GigabitEthernet0/2
     description ** to R3 **
     ip address 10.4.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    

Two iBGP paths - with Route Reflector Add-Path (MPLS)

In the following scenario, Site 1 uses a BGP-free core network with MPLS data forwarding. Due to the BGP Additional Paths feature the Route Reflector R2 advertises two next-hop addresses for the destination prefix 172.16.2.0 /24. This is how R1 receives the BGP next-hop of R4 as well as R5 in order to reach the Server in Site 2.

However, the BGP Add-Path feature on R1 does not install both routes into the RIB/FIB. In other words, although R1 receives two equal cost next-hop addresses in the BGP table for the same destination prefix (Site 2), R1 does not automatically install both routes in the IP routing table. For this reason, the BGP multipath feature is needed on R1 using the command maximum-paths ibgp 2.

Meanwhile, MPLS is enabled on R1, R3, R4 and R5. R2 is a BGP Route Reflector. R1, R4 and R5 share routes through an iBGP neighborship with R2. Such a design is called a BGP-free core because R3 does not have BGP enabled. Importantly, R3 has no knowledge of the Site 1 Host network (172.16.1.0 /24) or the Site 2 network (172.16.2.0 /24). R3 just forwards MPLS encapsulated traffic between R1, R4 and R5.

BGP multipath with Route Reflector Add-Path feature

Configuration:

R1
    R1#show run | sec router ospf
    router ospf 10
     router-id 1.1.1.1
     network 1.1.1.1 0.0.0.0 area 0
     network 10.1.0.0 0.0.0.3 area 0
    
    R1#show run | sec ^router bgp 
    router bgp 65001
     bgp router-id 1.1.1.1
     bgp log-neighbor-changes
     neighbor 2.2.2.2 remote-as 65001
     neighbor 2.2.2.2 update-source Loopback10
     !
     address-family ipv4
      bgp additional-paths receive
      network 172.16.1.0 mask 255.255.255.0
      neighbor 2.2.2.2 activate
      maximum-paths ibgp 2
     exit-address-family
    
    R1#show run int Lo10 | sec int
    interface Loopback10
     ip address 1.1.1.1 255.255.255.255
    
    R1#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to Host **
     ip address 172.16.1.2 255.255.255.0
     duplex auto
     speed auto
     media-type rj45
    
    R1#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R3 **
     ip address 10.1.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
     mpls ip
    
    R1#show run | sec ^mpls
    mpls label range 100 199
    mpls ldp router-id Loopback10 force
    
    R1#show run all | sec ^mpls ip$
    mpls ip
    
R2 (RR)
    R2#show run | sec ^router ospf
    router ospf 10
     router-id 2.2.2.2
     network 2.2.2.2 0.0.0.0 area 0
     network 10.2.0.0 0.0.0.3 area 0
    
    R2#show run | sec ^router bgp
    router bgp 65001
     bgp router-id 2.2.2.2
     bgp log-neighbor-changes
     neighbor 1.1.1.1 remote-as 65001
     neighbor 1.1.1.1 update-source Loopback10
     neighbor 4.4.4.4 remote-as 65001
     neighbor 4.4.4.4 update-source Loopback10
     neighbor 5.5.5.5 remote-as 65001
     neighbor 5.5.5.5 update-source Loopback10
     !
     address-family ipv4
      bgp additional-paths select all
      bgp additional-paths send
      neighbor 1.1.1.1 activate
      neighbor 1.1.1.1 route-reflector-client
      neighbor 1.1.1.1 advertise additional-paths all
      neighbor 4.4.4.4 activate
      neighbor 4.4.4.4 route-reflector-client
      neighbor 5.5.5.5 activate
      neighbor 5.5.5.5 route-reflector-client
     exit-address-family
    
    R2#show run int Lo10 | sec int
    interface Loopback10
     ip address 2.2.2.2 255.255.255.255
    
    R2#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R3 **
     ip address 10.2.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
R3
    R3#show run | sec router ospf
    router ospf 10
     router-id 3.3.3.3
     network 3.3.3.3 0.0.0.0 area 0
     network 10.1.0.0 0.0.0.3 area 0
     network 10.2.0.0 0.0.0.3 area 0
     network 10.3.0.0 0.0.0.3 area 0
     network 10.4.0.0 0.0.0.3 area 0
    
    R3#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R1 **
     ip address 10.1.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
     mpls ip
    
    R3#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to RR R2 **
     ip address 10.2.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R3#show run int Gi0/2 | sec int
    interface GigabitEthernet0/2
     description ** to PE R4 **
     ip address 10.3.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
     mpls ip
    
    R3#show run int Gi0/3 | sec int
    interface GigabitEthernet0/3
     description ** to PE R5 **
     ip address 10.4.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
     mpls ip
    
    R3#show run | sec ^mpls  
    mpls label range 300 399
    mpls ldp router-id Loopback10 force
    
    R3#show run all | sec ^mpls ip$
    mpls ip
    
R4 (PE)
    R4#show run | sec ^router ospf
    router ospf 10
     router-id 4.4.4.4
     network 4.4.4.4 0.0.0.0 area 0
     network 10.3.0.0 0.0.0.3 area 0
    
    R4#show run | sec ^router bgp
    router bgp 65001
     bgp router-id 4.4.4.4
     bgp log-neighbor-changes
     neighbor 2.2.2.2 remote-as 65001
     neighbor 2.2.2.2 update-source Loopback10
     neighbor 2.2.2.2 next-hop-self
     neighbor 10.5.0.2 remote-as 65002
    
    R4#show run int Lo10 | sec int
    interface Loopback10
     ip address 4.4.4.4 255.255.255.255
    
    R4#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R3 **
     ip address 10.3.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
     mpls ip
    
    R4#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R6 **
     ip address 10.5.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R4#show run | sec ^mpls  
    mpls label range 400 499
    mpls ldp router-id Loopback10 force
    
    R4#show run all | sec ^mpls ip$
    mpls ip
    
R5 (PE)
    R5#show run | sec ^router ospf
    router ospf 10
     router-id 5.5.5.5
     network 5.5.5.5 0.0.0.0 area 0
     network 10.4.0.0 0.0.0.3 area 0
    
    R5#show run | sec ^router bgp
    router bgp 65001
     bgp router-id 5.5.5.5
     bgp log-neighbor-changes
     neighbor 2.2.2.2 remote-as 65001
     neighbor 2.2.2.2 update-source Loopback10
     neighbor 2.2.2.2 next-hop-self
     neighbor 10.6.0.2 remote-as 65002
    
    R5#show run int Lo10 | sec int
    interface Loopback10
     ip address 5.5.5.5 255.255.255.255
    
    R5#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R3 **
     ip address 10.4.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
     mpls ip
    
    R5#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R6 **
     ip address 10.6.0.1 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R5#show run | sec ^mpls
    mpls label range 500 599
    mpls ldp router-id Loopback10 force
    
    R5#show run all | sec ^mpls ip$
    mpls ip
    
R6
    R6#show run | sec ^router
    router bgp 65002
     bgp router-id 6.6.6.6
     bgp log-neighbor-changes
     network 172.16.2.0 mask 255.255.255.0
     neighbor 10.5.0.1 remote-as 65001
     neighbor 10.6.0.1 remote-as 65001
    
    R6#show run int Gi0/0 | sec int
    interface GigabitEthernet0/0
     description ** to R4 **
     ip address 10.5.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R6#show run int Gi0/1 | sec int
    interface GigabitEthernet0/1
     description ** to R5 **
     ip address 10.6.0.2 255.255.255.252
     duplex auto
     speed auto
     media-type rj45
    
    R6#show run int Gi0/2 | sec int
    interface GigabitEthernet0/2
     description ** to Server **
     ip address 172.16.2.2 255.255.255.0
     duplex auto
     speed auto
     media-type rj45
    
R2#show ip bgp neighbors 1.1.1.1 | sec Addi
  Additional Paths send capability: advertised               « BGP Additional Paths are advertised from RR R2 to R1
  Additional Paths receive capability: received



R1#show ip bgp 172.16.2.0
BGP routing table entry for 172.16.2.0/24, version 9
Paths: (2 available, best #1, table default)
Multipath: iBGP
  Not advertised to any peer
  Refresh Epoch 1
  65002
    4.4.4.4 (metric 3) from 2.2.2.2 (2.2.2.2)                                     « R1 receives next-hop addresses from RR R2
      Origin IGP, metric 0, localpref 100, valid, internal, multipath, best       « R1 uses BGP multipath to install both next-hops in local RIB/FIB
      Originator: 4.4.4.4, Cluster list: 2.2.2.2
      rx pathid: 0x0, tx pathid: 0x0
  Refresh Epoch 1
  65002
    5.5.5.5 (metric 3) from 2.2.2.2 (2.2.2.2)
      Origin IGP, metric 0, localpref 100, valid, internal, multipath(oldest)
      Originator: 5.5.5.5, Cluster list: 2.2.2.2
      rx pathid: 0x1, tx pathid: 0



R1#show ip route 172.16.2.0
Routing entry for 172.16.2.0/24
  Known via "bgp 65001", distance 200, metric 0
  Tag 65002, type internal
  Last update from 5.5.5.5 00:14:18 ago
  Routing Descriptor Blocks:
    5.5.5.5, from 2.2.2.2, 00:14:18 ago                                « R1 receives next-hop addresses from RR R2
      Route metric is 0, traffic share count is 1
      AS Hops 1
      Route tag 65002
      MPLS label: none
  * 4.4.4.4, from 2.2.2.2, 00:14:18 ago
      Route metric is 0, traffic share count is 1
      AS Hops 1
      Route tag 65002
      MPLS label: none




R1#show ip cef 172.16.2.0 detail
172.16.2.0/24, epoch 0, flags [rib only nolabel, rib defined all labels], per-destination sharing
  recursive via 4.4.4.4
    nexthop 10.1.0.2 GigabitEthernet0/1 label 302-(local:104)                     « MPLS label switching is used between R1 and PE routers
  recursive via 5.5.5.5
    nexthop 10.1.0.2 GigabitEthernet0/1 label 303-(local:105)





Host#ping 172.16.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/3/4 ms   « Host can reach the Server



Host#trace 172.16.2.1 probe 1
Type escape sequence to abort.
Tracing the route to 172.16.2.1
VRF info: (vrf in name/id, vrf out name/id)
  1 172.16.1.2 2 msec
  2  * 
  3 10.4.0.2 2 msec
  4 10.6.0.2 4 msec
  5 172.16.2.1 4 msec




R1#show mpls forwarding-table
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop    
Label      Label      or Tunnel Id     Switched      interface              
100        Pop Label  10.4.0.0/30      0             Gi0/1      10.1.0.2    
101        Pop Label  10.3.0.0/30      0             Gi0/1      10.1.0.2    
102        Pop Label  10.2.0.0/30      0             Gi0/1      10.1.0.2    
103        301        2.2.2.2/32       0             Gi0/1      10.1.0.2    
104        302        4.4.4.4/32       0             Gi0/1      10.1.0.2       « MPLS forwarding table on R1 with labels to reach PE routers
105        303        5.5.5.5/32       0             Gi0/1      10.1.0.2    
106        Pop Label  3.3.3.3/32       0             Gi0/1      10.1.0.2 

Download section

Disclaimer: You download and use files from networkstudysite.com at your own risk.

Lab YAML files:

Packet captures:

How to use these files:

With YAML files you can easily recreate the example labs on networkstudysite.com. Learn more in this short guide.

Explore 313 packet captures

You can find more information at the following external links:

By clicking on the links below, you are leaving the networkstudysite.com website.

Cisco - BGP Multipath Load Sharing for Both eBGP and iBGP in an MPLS-VPN

Cisco - Chapter: Configuring eBGP and iBGP Multipath

Disclaimer:

Use at your own risk: networkstudysite.com makes no representations as to accuracy, completeness, currentness, suitability, or validity of any information found on this website. Full disclaimer on the About page.

Privacy Policy:

networkstudysite.com does not install browser cookies to collect or store your data.

Thank you for your interest in this blog post!

Looking for something else? View infographics, explore the archives or read the recommended posts below: