Next hop self bgp


BGP Next Hop Self

In BGP configuration, route advertisement is also done between external peers. During this advertisement, the non directly connected routers to this external peer, the IBGP peers, need to learn how to go to the advertised route. Because their routing table do not have this information and without any information, they can not go to the destination.

 

To give this information to the IBGP peers, “next-hop-self” command is used. With next-hop-self command, we force BGP to use a specific next hop instead of protocol’s choice.

 

Let’s see how, with a configuration example. The topology used for this next-hop-self command is below:

BGP Next-Hop-Self Command
In this topology, Router A1 and Router B1 are external BGP peers. And the Router A2 and Router B2 are their internal BGP peers. Router A2 advertises its 20.0.0.0/24 network with the next hop 10.0.0.1 (ip address of Router A1’s external interface).Because of the fact that, this 10.0.0.1 ip address is not in the routing table of Router B2, it do not know this route.

 

This is also like the same for Router B2’s 40.0.0.0/24 route advertisem
next hop self bgp

When a BGP router advertises a prefix, it includes a next-hop address.

You can find this in the UPDATE message:

  • Network Layer Reachability Information (NLRI) field: this contains the prefix and prefix length.
  • Path attributes: this contains the NEXT_HOP field.

This next hop differs depending on whether you use external BGP (eBGP) or internal BGP (iBGP):

  • An eBGP router typically advertises its own IP address as the next hop when it sends a prefix to another eBGP router.
  • An iBGP router typically keeps the next hop speak to unchanged.



In this lesson, we’ll seize a look at this default behavior on some routers.

Configuration

Here is the topology we’ll use:

We contain six routers in different autonomous systems (AS). The routers in AS 456 run iBGP and use their loopback interfaces for the BGP neighbor adjacency. With these routers, we have plenty of next-hop addresses to stare at.

I use IOSv Software (VIOS-ADVENTERPRISEK9-M), Version 15.9(3)M on all routers.

Configurations

Want to take a look for yourself? Here, you will discover the startup configuration of each device.

R1

R2

R3

R4

R5

R6

Verification

Let’s look at some next-hop addresses.

eBGP

How to Set the BGP Next Hop to self" When Reflecting a Route"

Overview

This document describes how to configure BGP next hop and set it to the router ID of the route reflector, when a route is reflected (learned from an iBGP peer and advertised to iBGP route reflector clients).

Details

RFC 4456, BGP Route Reflection: An Alternative to Full Mesh Internal BGP (IBGP), advises against modifying the NEXT_HOP, among other attributes, when reflecting a route:

10.  Implementation Considerations

[...]

In addition, when a RR reflects a route, it SHOULD NOT modify the

following path attributes: NEXT_HOP, AS_PATH, LOCAL_PREF, and MED.

Their modification could potentially result in routing loops.

PAN-OS 5.0:

In PAN-OS 5.0, setting the BGP next hop to "self", when reflecting a route, is performed by setting the configuration option "Export Next Hop" to "Use Self" on the "Virtual Router - BGP - Peer Group/Peer" configuration page.

In the screenshot below, the iBGP peer 192.168.200.13 is configured as a route reflector client to the local firewall, 192.168.200.11. BGP parameters of the route reflector client

In the screenshot below, &

One potential issue with iBGP is that it doesn’t change the next hop IP address. Sometimes this can cause reachability issues. Let’s look at an example:

Above we have R1 and R2 in AS 12 running iBGP. R3 is in AS 3 and we use eBGP between R2 and R3. Once we advertise network 3.3.3.0 /24 on R3 in BGP then R2 will learn this prefix and stores it in its BGP table, the next hop IP adress will be 192.168.23.3.

Once R1 learns about prefix 3.3.3.0 /24 then the next hop IP address will remain 192.168.23.3. When R1 doesn’t know how to reach this IP address then it will fail to install 3.3.3.0 /24 in its routing table.

Let’s take a look at the configuration, I’ll show you two methods how we can deal with this issue.

Configuration

Here’s the BGP configuraton that we will use:

The configuration is pretty straight forward. We use iBGP between R1/R2 and eBGP between R2/R3. On R3 we advertised 3.3.3.0 /24 in BGP. Let’s take a look at the BGP tables:

R2 has installed 3.3.3.0 /24 in its BGP table and it is a valid route, the next hop is 192.168.23.3. Let’s check R1:

R1 learns the prefix but it’s unable to install it in the routing

Next-hop-self route reflector and inter-AS option B

Next-hop-self route reflectors (NHS-RR) are used in BGP networks to reduce the need for fully meshed iBGP connections within a single autonomous system (AS). In a fully meshed AS, iBGP routers do not advertise routes to their neighbors, while NHS-RR allows a route reflector (RR) to advertise learned iBGP routes to iBGP neighbors with its own address as the next hop. This feature connects different domains within the same AS and improves the overall scale.

Inter-AS option B is a method for interconnecting VPN sites located in different ASes. Using this method, autonomous system border routers (ASBRs) are directly connected and routes are exchanged on a single interface.

EVPN IFL and VPN-IPv4/IPv6 routes both support NHS-RR capability and inter-AS option B.

The following figure shows the configuration of NHS-RR and inter-AS option B:

The preceding figure shows two different ASes that are connected via inter-AS option B ASBRs br4, br5, and br6. This method allows for the extension of EVPN and IP-VPN services across different MPLS or segement routing MPLS domains without providing services on border routers.

Egress PEs adve