BGP Next Hop Self

Hi Georgi,

When you change the next hop on R2 then R1 will know how to reach R3.

Once R3 receives the packet, does it know how to reach the destination? ( It probably doesn’t unless you advertise that network on R2.

When you face problems like this, you need to “follow” the IP packet. Think about the source/destination IP address in the packet and then check if each router knows how to forward it :slight_smile:


1 Like

Hi Rene, correction: should be

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

Thanks Kam, I had to look twice to spot it :slight_smile:

Typo Rene,


R3 in is AS 3 and we use eBGP between R2 and R3.

Thanks Victor, it has been fixed.

The reason for this is why BGP is different from other routing protocols. In fact, it is legitimate to view BGP not as a routing protocol at all, but instead as an application that supplies you with what’s called NLRI (Network Layer Reachability Information). Think of it this way: While routing protocols tell you HOW to get somewhere (they are always concerned with the next hop on a hop-by-hop basis), BGP tells you WHERE you need to go, but not how. It is up to the router to figure out how to get to the destination supplied by BGP, by looking at its own routing table / CEF to figure out the next hop.

With this BGP philosophy in mind, by not changing to Next Hop Self, BGP allows your internal routing protocols to make the determination what is the best exit point in your internal network to get to the Next Hop being advertised by BGP. Of course, this assumes that your IGP knows about the link in question.

As further evidence of this philosophy, look at the Administrative Distance of internal BGP: 200! Why is it so high? It is because the designers of BGP want iBGP to be the last resort (compared to any true internal routing protocol) for internal routing purposes.


Rene, don’t you have to use route reflector from R2 to R1?
I thought IBGP won’t advertise routes to another IBGP


Hi Hoan,

iBGP uses split horizon which means that it won’t advertise prefixes to iBGP neighbors that is has learned from other iBGP neighbors. You can read more about it here:

Internal BGP explained


1 Like

Hi Rene

Great Lesson, If an isp is peering with another isp via bgp to share routes would it simply put the next hop self for its own routes when advertising to its peer.

Thanks simon

Presumably the BGP relationship between routers of two different ISPs will be External (not Internal BGP). External BGP, by default, changes the next hop attribute of advertised routes to be the router’s own address. So to answer your question, yes.

Hi Rene,
Why the route is valid () although the next-hop is not reachable?
what is the benefit of (
) symbol if the route is not reachable?

Hi Mahmoud,

Which example are you referring to? Could you paste the output of the console here?


Hi Rene,
in this example:

R1#show ip bgp
BGP table version is 1, local router ID is
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
* i3.3.3.0/24             0    100      0 3 i

The next-hop is not reachable,however, the route is valid.
it doesn’t make sense to put * and mark the route as valid if the next-hop is not reachable

19 posts were merged into an existing topic: BGP Next Hop Self

If there are multiple routers in IBGP is it necessary to configure next hop self on all IBGP routers?

Hello @giorgiortavidze,

Many thanks for your question. It is not necessary to configure next-hop-self on all iBGP routers and can have undesirable results. Any time we configure this we are modifying the original routes and modifying routes should always be done with care. Even better we try to avoid the need to modify routes by appropriate design choices.

Next hop self is one possible solution if a router receiving the unmodified route would be unable to understand how to reach the specified next hop. Although we can modify the route in BGP, a common alternative is to provide the router with an additional piece of information about how to reach the specified next-hop, for example providing a static route to that next hop or having another routing protocol (such as OSPF) operating more locally sharing information about exit points from your network.

If we apply next hop self by default a common issue is that traffic will flow but follow a sub-optimal path such as looping via a transit AS (it might be some remote branch site) rather than taking a more direct route with more bandwidth available. Connectivity can feel “slow” but not broken in this case.

So you have several options you can design into your network. Have fun choosing!
Kind regards,

1 Like

Ok I was working through the first part above. I created my own GNS3 lab to follow.

I got to the part where you state that you can just add the network mask to R2 to allow R1 to see the network. Sure enough this worked.

See below a picture of my lab its the same except I used for my loopback instead of and I also used one different interface on R2 but that was just mistake on my part that did not effect the lab so I left it.

My question was even though all the BGP networks and routes show up I still cannot ping the address of from R1 to R3. Why is that? can you not ping over BGP? how can you not ping over it but the network traffic and routes work just fine?

Should they not have had IGP or static routes underneath the BGP or was it not needed because both IBGP routers are directly connected and then the R3 and R2 are connected directly over EBGP. if I run a capture you can tell the IP are getting there but just no reply and that’s because R3 does not know how to get back to R1 which makes sense as there is no IGP or static route. However, back to the question in bold about how come BGP can get back and forth but the ping cannot.


Sure enough if I add a static route the ping works so its just as I said above.



after adding static route:

So if this was a real world scenarios for an ISP it does not seem like BGP could help with any transit data because it certainly didn’t help with the ping. So is this lab an incomplete lab that is not really a working model because there is no underlying routing protocols or static routes?
In other words it seems to me that BGP lies to us when it says its connected because if it was connected we should be able to ping. OH well I am getting off topic maybe when you answer my question in bold it will explain everything.

wireshark after I added static route:

I went ahead and removed the static route to watch the wireshark traffic. I still see traffic but I just have to wonder if any payload data would be transmitted over BGP for example SIP, or IP traffic regular PC stuff. Why would ICMP(pings) be blocked but the rest of the traffic make it or would none of the traffic make it and just the BGP and management traffic only be transmitted??? Which if that was the case then BGP really does nothing but send its own crap over the network which I don’t see how that helps move data over the internet.


I have been just sitting and watching wireshark racking my brain. I finally highlighted all the Internet p[rotocol version 4, which should be the IP correct? all of the traffic is just the /24 network nothing from the /24 network.

That tells me the following if we don’t see any IP traffic from the network that means no payload or transit data would ever get to us from the /24.

Maybe I am wrong but it seems to me that BGP then cannot work without underlying routing protocol or static route because you would never receive information from another subnet that was not directly connected.

So if John Smith on his PC was on and he was trying to get to the internet which was the /24 network he would never reach it. which makes bgp worthless without a IGP or static route of some type? correct? Even the BGP its receiving is only from the /24 network.

I setup a wireshark on the IBGP link between R1 and R2 and I don’t even see BGP keep alives there:

I am unsure why there are no BGP keep alives between R1 and R2.

wait I see why… there is no network command on R1, or R2 its on R3 only. Let me add one to the other two and test it.

router bgp 12
 no synchronization
 bgp log-neighbor-changes
 neighbor remote-as 12
 neighbor next-hop-self
 neighbor remote-as 3
 no auto-summary


router bgp 12
 no synchronization
 bgp log-neighbor-changes
 neighbor remote-as 12
 no auto-summary


router bgp 3
 no synchronization
 bgp log-neighbor-changes
 network mask
 neighbor remote-as 12
 no auto-summary

Ok maybe NEVER MIND… when I added the network mask command to R2 I can now ping on R3.

So the problem was me not BGP. BGP is behaving normally it will work with traffic as the ping worked… I just had not advertised the /24 through BGP.

So I just have to ask this how does the BGP /24 route show up in R1 BGP table even though I could not previously ping it? The other stuff now makes sense but that question remains.

Oh and a second question. How come I don’t see BGP Keep alives betgween R1 and R2 on the IBGP side and I do see them between R2 and R3 which is a EBGP connection. does IBGP not use keep alives. not sure what the TCP are for I guess just “ACK”?


Hello Brian

It’s nice to see how you are working through the problem and we can “read your thoughts” along the way.

So, having answered your own original question, here’s the question that I’ll try to answer:

You must remember one of the fundamental laws of routing: If a route is successful in one direction, it does NOT mean that it will be successful in the other. So R3 was able to communicate with R2 and R1 the route to the network. So it is possible for R1 to reach R3. This is the perspective or R1 since there is a route from R1 to However, if you looked at the routing table of R3 (which you did) you will see that there is no route back to R1 without the appropriate network commands.

So looking at the routing table in R1 only shows you that R1 can reach R3. It says nothing about R3 reaching R1. In order to determine that you’ll have to look at the routing table on R3.

I hope this has been helpful!


1 Like


So I can apply that rule to routes? Meaning as long as it can get there it will be added just not reachable because it knows how to get there but not the way back.

That does make perfect sense…gosh… I should have thought about that or at least posed it as a question. I was thinking that it probably had to do with some rule I had learned at some point about TCP/IP and traffic movement but just didn’t think of what was right in front of me. I hate when I do that but that happens a lot lol…

Ok now that makes sense and I can put it in a nice little box and label it lol… thanks!

1 Like

any thoughts on this ? Even I am wondering why it shows as valid route ?