cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
168
Views
0
Helpful
5
Replies
Highlighted

BGP next hop issue

Hi All

 

Just need help with a small routing problem. So I have a route being learnt on a router via BGP.

 

Lets assume it is 172.16.100.0/24 via next hop 192.168.254.1.

 

Now, the gateway 192.168.254.1 is also being learnt as a summary route via BGP from the same neighbor.

 

In the routing table however, the route does not pick up the correct gateway and instead all traffic is routed via default route.

 

How can I resolve this? I assume this is because BGP does not use next hop if it is being learnt via BGP itself?

 

Thanks in advance.

5 REPLIES 5
Highlighted
VIP Mentor

Re: BGP next hop issue

Hello,

 

in general, the more specific route gets chosen. That said, post the configs of both BGP neighbors so we can get a better picture of what is going on...

Highlighted
Hall of Fame Guru

Re: BGP next hop issue

 

Is this EBGP or IBGP. 

 

If it is EBGP then usually the next hop is the neighbor IP on a directly connected subnet or if you are using loopbacks then you add a static route just for that loopback so the neighborship can be formed. 

 

If it is IBGP then you can use the next-hop-self command. 

 

Jon

Highlighted
Cisco Employee

Re: BGP next hop issue

The BGP summary route should be used to resolve the BGP next hop. Can you post the output for "show bgp ipv4 uni 172.16.100.0 255.255.255.0".

 

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México
Highlighted
Collaborator

Re: BGP next hop issue

Hi,

 

    It has to do with BGP next-hop validation:

           - if your BGP neighbor is directly attached (192.168.254.1) both received routes (172.16.100.0/24 and summary for 192.168.254.1) will have a next-hop of 192.168.254.1; before BGP pushes both prefixes to the RIB, it needs to validate next-hop by matching on a non-default route in the RIB (which it finds as next-hop is connected), in which case both prefixes will be sent to the RIB and show up as BGP routes (unless you learn it from another protocol with a lower AD as well, which wins the RIB election; you should see this with "show bgp ipv4 unicast rib-failure").

           - if your BGP neighbor is non directly attached (192.168.254.1) both received routes (172.16.100.0/24 and summary for 192.168.254.1) will have a next-hop of 192.168.254.1; before BGP pushes both prefixes to the RIB, it needs to validate next-hop by matching on a non-default route in the RIB, and it's not gonna match because it is not directly connected and you only have a default route in the RIB; BGP next-ho validation fails, thus prefixes are NOT sent to the RIB, thus don't show up in the RIB, thus all packets follow the default route, your only route in the RIB. To fix it, configure a static route for 192.168.254.1/32 and you'll see both BGP prefixes showing up in the RIB. Before doing the change, you could see that next-hop is inaccessible by issuing "show bgp ipv4 unicast 172.16.100.0

 

Regards,

Cristian Matei.

       

 

           

          

Highlighted

Re: BGP next hop issue

I will post the network diagram and the configs for this by tomorrow. I think that will make it more clear.