cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
17975
Views
11
Helpful
3
Replies

Explain Next-Hop Self in BGP

EAleg
Level 1
Level 1

Guys, please, can You tell me, why we need next-hop self (and neighbor next-hop-unchanged) in iBGP or eBGP?

Thank You for answer and attention. Good luck!

Here's schema for explanation, if need

qm2GlXn.jpeg

1 Accepted Solution

Accepted Solutions

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @EAleg ,

the default behaviuor is different towards iBGP peers and eBGP peers

to iBGP peers the original BGP next-hop attribute is left unchanged. However, this can create issues as the point to point links between border routers may likely be not advertised in IGP causing the iBGP peers to discard the BGP advertisement   ( no route to BGP next-hop).

In a pure IP network a possible solution could be that of advertising border p2p links in IGP using passive-interface option.

However, this workaround does not work well on MPLS based backbones that would like to use the LSPs that have destination = loopback addresses of PE and P nodes.

The bgp next-hop self solves this issue and allows to change the BGP next-hop attribute to a consistent value = loopback address solving the problem of installation og BGP advertisements ( now the BGP next-hop is known via IGP) and allowing also for MPLS networks to use recursion and put the traffic over the LSP with destination = originating iBGP node loopback address making MPLS forwarding to work well without the need for addtional labels to be consumed to map the BGP prefixes ( also this is important for scalability as the MPLS label space is limited to 20 bits integer).

 

The default behaviour towards eBGP peers is actually the opposite the BGP next-hop attribute is re-written to the address used on the session with the current eBGP peer ensuring that the BGP next-hop address is reachable ( it becomes directly connected or known via static routes for eBGP sessions using loopbacks).

There are some special cases when this automatic change of BGP next-hop is not desirable.

Here I describe the most important scenario where BGP next-hop-unchanged is desirable : let's consider an Internet exchange with one VLAN and IP subnet where each participant connects a router to. Each device will have an IP address on the comon subnet.

Now not all ISPs are willing to configute eBGP session to everyone.

The IXP has its own routers that can act as BGP servers : they peer with every participant in the internet exchange point . Some participants can use the eBGP session with the IXP to receive all the routes of all the partecipants.

For scalability reasons the IXP router should not change the BGP next-hop so that traffic to an ISP x can be sent directly from ISP y because the BGP next-hop is in the same common IP subnet.

 

So in general the BGP next-hop-unchanged is useful in this kind of scenarios specially to avoid that traffic has to be sent to someone when the original next-hop can be reached directly by other eBGP peer(s).

 

Hope to help

Giuseppe

 

View solution in original post

3 Replies 3

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @EAleg ,

the default behaviuor is different towards iBGP peers and eBGP peers

to iBGP peers the original BGP next-hop attribute is left unchanged. However, this can create issues as the point to point links between border routers may likely be not advertised in IGP causing the iBGP peers to discard the BGP advertisement   ( no route to BGP next-hop).

In a pure IP network a possible solution could be that of advertising border p2p links in IGP using passive-interface option.

However, this workaround does not work well on MPLS based backbones that would like to use the LSPs that have destination = loopback addresses of PE and P nodes.

The bgp next-hop self solves this issue and allows to change the BGP next-hop attribute to a consistent value = loopback address solving the problem of installation og BGP advertisements ( now the BGP next-hop is known via IGP) and allowing also for MPLS networks to use recursion and put the traffic over the LSP with destination = originating iBGP node loopback address making MPLS forwarding to work well without the need for addtional labels to be consumed to map the BGP prefixes ( also this is important for scalability as the MPLS label space is limited to 20 bits integer).

 

The default behaviour towards eBGP peers is actually the opposite the BGP next-hop attribute is re-written to the address used on the session with the current eBGP peer ensuring that the BGP next-hop address is reachable ( it becomes directly connected or known via static routes for eBGP sessions using loopbacks).

There are some special cases when this automatic change of BGP next-hop is not desirable.

Here I describe the most important scenario where BGP next-hop-unchanged is desirable : let's consider an Internet exchange with one VLAN and IP subnet where each participant connects a router to. Each device will have an IP address on the comon subnet.

Now not all ISPs are willing to configute eBGP session to everyone.

The IXP has its own routers that can act as BGP servers : they peer with every participant in the internet exchange point . Some participants can use the eBGP session with the IXP to receive all the routes of all the partecipants.

For scalability reasons the IXP router should not change the BGP next-hop so that traffic to an ISP x can be sent directly from ISP y because the BGP next-hop is in the same common IP subnet.

 

So in general the BGP next-hop-unchanged is useful in this kind of scenarios specially to avoid that traffic has to be sent to someone when the original next-hop can be reached directly by other eBGP peer(s).

 

Hope to help

Giuseppe

 

balaji.bandi
Hall of Fame
Hall of Fame

From My notes :

 

The NEXT_HOP is a well-known mandatory attribute that defines the IP address of the router that SHOULD be used as the next hop to the destinations listed in the UPDATE message.  The next-hop-self is used to overcome not having an IGP route to the next hop of prefixes advertised. In order to make sure you can reach the eBGP next-hop, including the network that the next hop belongs to in the IGP or issue the next-hop-self neighbor command to force the router to advertise itself, rather than the external peer, as the next hop

 

in an external BGP (eBGP) session, by default, the router changes the next hop attribute of a BGP route (to its own address) when the router sends out a route. If the BGP Next Hop Unchanged feature is configured, BGP will send routes to an eBGP multihop peer without modifying the next hop attribute.  (most used cased in MPLS and Service prvider network)

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

...

Review Cisco Networking for a $25 gift card