IBGP Next-Hop Behavior

The EBGP next-hop attribute is the IP address that is used to reach the advertising router. For EBGP peers, the next-hop address is, in most cases, the IP address of the connection between the peers. For IBGP, the EBGP next-hop address is carried into the local AS.

One potential issue with IBGP is that it doesn’t change the next hop IP address. Sometimes this can cause reachability issues.

Example:

  • R2 and R3 in AS 64511 running IBGP.
  • R1 in AS 64496, EBGP session between R1 and R2.
  • Once we advertise the 209.165.201.0/27 on R1 in BGP, R2 will learn this prefix and stores it in its BGP Table, the Next-Hop IP Address will be 209.165.202.129.
  • Once R3 learns about this prefix, the Next-Hop IP will remain 209.165.202.129. R3 doesn’t know how to reach this IP then it will fail to install 209.165.201.0/27 in its RIB.
IBGP Next-Hop Behavior
				
					// R2
router bgp 64511
 bgp log-neighbor-changes
 neighbor 192.168.1.3 remote-as 64511
 neighbor 192.168.1.3 next-hop-self
 /* Allows R2 to advertise itself as the next hop to its IBGP neighbor 
 for networks learned from AS 64496.
 R3 will then use 192.168.1.2 as the next hop to reach network 209.165.201.0/27 
 instead of using the EBGP next hop of 209.165.202.129 */
 neighbor 209.165.202.129 remote-as 64496
				
			
				
					' R1 '
R1#show bgp ipv4 unicast 
/* BGP table version is 2, local router ID is 209.165.201.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
              t secondary path, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found */

     Network          Next Hop            Metric LocPrf Weight Path
 *>   209.165.201.0/27 0.0.0.0                  0         32768 i
R1#

' R2 '
R2#show bgp ipv4 uni summ
/* BGP router identifier 209.165.202.130, local AS number 64511
BGP table version is 2, main routing table version 2
1 network entries using 144 bytes of memory
1 path entries using 84 bytes of memory
1/1 BGP path/bestpath attribute entries using 160 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 412 total bytes of memory
BGP activity 1/0 prefixes, 1/0 paths, scan interval 60 secs */

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
192.168.1.3     4        64511       6       7        2    0    0 00:02:30        0
209.165.202.129 4        64496       9       8        2    0    0 00:05:18        1
R2#

R2#show ip route bgp
/* output omitted */
Gateway of last resort is not set
      209.165.201.0/27 is subnetted, 1 subnets
B        209.165.201.0 [20/0] via 209.165.202.129, 00:05:07
R2#

' R3 '
// No route installed in BGP table

R3#show bgp ipv4 unicast
R3#

*Jul  7 02:09:25.018: BGP(0): 192.168.1.2 rcvd UPDATE w/ attr: nexthop 209.165.202.129, origin i, localpref 100, metric 0, merged path 64496, AS_PATH 
*Jul  7 02:09:25.020: BGP(0): 192.168.1.2 rcvd 209.165.201.0/27
*Jul  7 02:09:25.022: BGP(0): no valid path for 209.165.201.0/27

// next-hop-self configured on R2

*Jul  7 02:12:27.428: BGP(0): 192.168.1.2 rcvd UPDATE w/ attr: nexthop 192.168.1.2, origin i, localpref 100, metric 0, merged path 64496, AS_PATH 
*Jul  7 02:12:27.431: BGP(0): 192.168.1.2 rcvd 209.165.201.0/27
*Jul  7 02:12:27.433: BGP(0): Revise route installing 1 of 1 routes for 209.165.201.0/27 -> 192.168.1.2(global) to main IP table

R3#show ip route bgp
/* output omitted */
Gateway of last resort is not set
      209.165.201.0/27 is subnetted, 1 subnets
B        209.165.201.0 [200/0] via 192.168.1.2, 00:01:31
R3#
				
			
Tags:

Leave a Reply

Related Post