01-17-2014 12:29 PM - edited 03-04-2019 10:06 PM
Hello,
I've got some smaller routers that can't handle a full routing table. I was wondering how a router handles dual default routes over BGP all things being equal? In this case i'd want to set it up so that one would be the primary and if it failed the 2nd would take over. Would I need to set any attributes to acheive this?
Thanks for your help,
David
Solved! Go to Solution.
01-17-2014 01:17 PM
David
I'm assuming this is all on the same router.
If BGP receives two default routes then unless you have added extra configuration it will use only one of them. So all things being equal it will choose the route from the neighbor with the lowest IP address. The extra configuration needed to have both routes installed would be to add these commands -
maximum-paths 2 <--- this allows BGP to install the two routes
bgp bestpath as-path multipath-relax <--- when you allow BGP to install multiple routes to the same destination a further requirement is that not only does the AS PATH have to be the same length it also has to have the same AS numbers in it. In your case the AS numbers would not be the same because you are using different providers.
This command allows that rule to be relaxed so the AS numbers do not have to match. It is a hidden IOS command. it should also be noted that is not recommended to use this if you are a transit AS.
However in your case, assuming you did not have any of the extra configuration above and assuming all things are equal then if the link you want to use as primary has the neighbor with the lowest IP address then you don't have to do anything. If however the default route that would be installed in the routing table points to the wrong link then you could apply a higher weight to the route you wanted to use and that one would be installed.
That said it may be a good idea to apply the weight anyway, regardless of whether BGP picks the right route or not, as this is then obvious to anyone looking at configuration that you are explicitly choosing one route over the other. But you don't have to if BGP picks the right one anyway.
The weight attribute is only significant to the local router ie. it is not passed to any other BGP peers.
Jon
01-17-2014 01:17 PM
David
I'm assuming this is all on the same router.
If BGP receives two default routes then unless you have added extra configuration it will use only one of them. So all things being equal it will choose the route from the neighbor with the lowest IP address. The extra configuration needed to have both routes installed would be to add these commands -
maximum-paths 2 <--- this allows BGP to install the two routes
bgp bestpath as-path multipath-relax <--- when you allow BGP to install multiple routes to the same destination a further requirement is that not only does the AS PATH have to be the same length it also has to have the same AS numbers in it. In your case the AS numbers would not be the same because you are using different providers.
This command allows that rule to be relaxed so the AS numbers do not have to match. It is a hidden IOS command. it should also be noted that is not recommended to use this if you are a transit AS.
However in your case, assuming you did not have any of the extra configuration above and assuming all things are equal then if the link you want to use as primary has the neighbor with the lowest IP address then you don't have to do anything. If however the default route that would be installed in the routing table points to the wrong link then you could apply a higher weight to the route you wanted to use and that one would be installed.
That said it may be a good idea to apply the weight anyway, regardless of whether BGP picks the right route or not, as this is then obvious to anyone looking at configuration that you are explicitly choosing one route over the other. But you don't have to if BGP picks the right one anyway.
The weight attribute is only significant to the local router ie. it is not passed to any other BGP peers.
Jon
01-20-2014 06:28 AM
Hi Jon,
Thanks for your reply,
The upstream provider I have for the backup link is advertising to its network that it can reach me through its link. While on my side i've only got the one default route as active from my other provider.
I've tried adding as path prepending to the link but even so through their looking-glass I see my AS number repeated 5 times still as the best route in that network (and its direct peers) which should be the backup.
Any ideas appreciated as to what may be going on?
Thanks
David
01-20-2014 06:34 AM
David
Okay the default route question and answer is only about outgoing traffic.
So you now have a problem with inbound traffic ?
If so what does the route that you want to prefer look like ie. does it have a smaller AS PATH length than the one you did AS prepending on ?
Jon
01-20-2014 06:59 AM
Hi Jon,
It should according to what I can see:
From the backup link looking-glass:
When I have the Primary ISP on only (This would be the way I'd want it to look like)
BGP routing table entry for xxx.xxx.xxx.xxx/24
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
3356 zzzz yyyy
64.230.195.161 from 64.230.193.109 (64.230.195.161)
Origin IGP, metric 0, localpref 105, valid, internal, best
Community: 577:55 577:5504 577:10200 577:21216
Originator: 64.230.195.161, Cluster list: 64.230.193.109 64.230.193.187
Last update: Sun Jan 19 14:48:26 2014
When I have both the primary and (prospective) backup link on:
BGP routing table entry for xxx.xxx.xxx.xxx/24
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
yyyy yyyy yyyy yyyy
64.230.194.193 from 64.230.193.109 (64.230.194.193)
Origin IGP, metric 0, localpref 140, valid, internal, best
Community: 577:10232 577:21216 577:62004
Originator: 64.230.194.193, Cluster list: 64.230.193.109 64.230.193.186 64.230.193.16
Last update: Sun Jan 19 23:55:48 2014
Thanks,
--Dave
01-20-2014 07:32 AM
Dave
If you look at the local preference values you can see that the route you have AS prepended has a higher local preference than your primary link route.
Local preference is used before AS PATH to choose the best route so that is why it is using the "wrong" advertisement.
Why it is doing this i don't know as this will be something set by the ISP themselves.
Jon
01-17-2014 02:03 PM
David
Apologies i forgot to answer your other question.
Yes, if the link with the current default route goes down the other default route would be installed in the IP routing table and be used. When the primary link came back up the router should then remove the current default route and reinstall the default route via the primary link.
Jon
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide