06-30-2021 11:51 PM
WE have a two connections to our ISP same AS and exact same BGP config exept for neigbor statement obviuously, My question is can I use BGP Weight attribute on a per prefix basis and send traffic down either link depending on weight or do I have to stipulate the weight under the neigbor staement where this affects all routes.?? also with this two link set up how will BGP route the traffic by default what will it base its routing decision on.??
Thanks
Solved! Go to Solution.
07-05-2021 07:10 AM
Hello @benolyndav ,
are you using real devices or an emulation tool in your LAB ?
if you are connecting via a L2 switch of course shutting down the interface will not tear down the remote side, but if they are directly connected it should.
In real world instead of using low BGP timers you can try to use BFD in cooperation with your ISP ( both sides should use BFD to achieve fast detection)
Hope to help
Giuseppe
07-01-2021 12:18 AM - edited 07-01-2021 12:21 AM
Hello
you can set weight per network or host using route- maps or you can set bgp default of the neighbour
Note - weight is only locally significant so as long as the two isps peer with the single rtr you can use it.
lastly bgp path selection is still taken into consideration even with two isp peerings
example;
ip prefix-list 10 permit 10.10.10.0/24
route-map weight permit 10
match ip address prefix-list 1
set weight 55000
router bgp xx
neighbour xxxx route-map weight in
neighbour yyyy weight 50000
07-01-2021 01:00 AM
Hello @benolyndav ,
if the two eBGP neighbors are terminated on different routers on your side you should use local preference instead of weight, because weight is local to a single router, local preference is a true BGP attribute propagated inside your AS over iBGP sessions.
An hgher value of local preference is preferred so you can follow @paul driver suggestions about route-maps , but instead of setting weight you can set local preference.
if both eBGP neighbors are terminated on the same router you can use weight , but you have a single point of falure.
Hope to help
Giuseppe
07-01-2021 01:27 AM
Hi
Thanks for the reply
so we have a stack switch where SW1 is connected to ISP RTR1 and Sw2 is connected to ISP RTR 2 not different ISP's but the same ISP and same AS number and exact same BGP config except Neigbor IP, all traffic presently going over one link 1 then when ISP drop BGP on that link all traffic then goes over link 2 , but when ISP bring the other link back up the routes still point to link 2 peer, as all BGP config is the same could this be the oldest route rule because ISP dropped BGP on link 1 then allowe traffic over Link 2 wouldn link 2 now be the oldest route. ??
Thanks
07-01-2021 02:11 AM - edited 07-01-2021 02:13 AM
Hello
@benolyndav wrote:
, but when ISP bring the other link back up the routes still point to link 2 peer, as all BGP config is the same could this be the oldest route rule because ISP dropped BGP on link 1 then allowe traffic over Link 2 wouldn link 2 now be the oldest route. ??
As bgp path selection is always taken into consideration then things equal possibly oldest route would take preference in this case but it could even go down to even lowest neighbor ID (lower ip address to peering neighbor)
07-01-2021 05:00 AM
Hi Paul
Thanks for the great info, I think the routes still pointed to link 2 peer because everything is equal in BGP's eyes so why would it change, also if I set a route map with prefix lists and use local preference for certain subnets what happens if the link fails will they automatically route over link 1, ?
07-01-2021 05:20 AM - edited 07-01-2021 05:22 AM
Hello
You wouldn’t use local preference in this case as you have no ibgp sessions, For you say this is a single router with two ebgp peerings to the same ISP ASN so weight is more applicable on your received routes and if you do use route-maps to manipulate the routing path then yes if you lose a ebgp session traffic will failover.
07-01-2021 05:25 AM
Hello @benolyndav ,
you have a stack that acts as a single device so you could use weight or local-preference at your choice.
>> if I set a route map with prefix lists and use local preference for certain subnets what happens if the link fails will they automatically route over link 1, ?
Yes your understanding is correct , for all the time the link is down all the routes will be routed via the other still alive link regardless of local preference or weight settings.
With BGP eBGP fast extenal fallover as soon as link down is detected the neighbor is declared down and all the routes with its next-hop are removed from BGP table.
If later the link comes back up and some routes via this link/neighbor have better attributes ( higher weight or higher local preference) they will be installed again as best path and used in IP routing table.
Hope to help
Giuseppe
07-01-2021 08:39 AM
Hi Giuseppe
Thanks for the valuable info
So we ran into an issue when testing when the ISP shut BGP down on Link1 then all traffic routed across Link2 as mentioned earlier, when the ISP no shut the BGP on Link1 and both links were peering we had asymetric routing, traffic from our stack routed across Link2 but the ISP said that returning traffic was going across Link1.
How do i set this up to favour Link1 and route across Link2 incase of a failure, will setting weight inbound affect our traffic outbound.??
Thankyou
07-01-2021 10:14 AM
Hello @benolyndav ,
>> How do i set this up to favour Link1 and route across Link2 incase of a failure, will setting weight inbound affect our traffic outbound.??
Yes it is enough to associate an higher weight to neighbor on link 1
note: as already explained by @paul driver
router bgp <your AS>
neighbor x1.1x1.x1.x1 weight 42000
neighbor x2.x2.x2.x2 route-map set-weight-some-prefixes
Hope to help
Giuseppe
07-04-2021 11:01 PM
Hi Giuseppe
Thanks again
So I set this up in CML and I set the weight to 4200 on the Link 1 neighbor and it does work when I shut BGP on Link 1 all traffic goes over Link 2 then when I re-enable BGP on Link 1 thetraffic chooses Link 1 again, Great stuff.
in our config I see we are using route-maps which call acl's and these acl's set the community this is to do with how we are telling our ISP which route for which site is primary and secondary has we have two data centres and the community is set to 28 and 29.
I can see I dont need a route map to get the weight working correctly as I have tested this, but if I were to use a route map for this or maybe local preference would that affect the route maps already in use.??
07-02-2021 04:35 AM
I try To build One Complete Design for Dual ISP to be the reference for me and for other,
As you mention even if the dual ISP is up all traffic is go through the ISP 1!!,
AS is same "as you mention above" this make iBGP for all between the SW and ISP router.
I will talk about both is UP.
SW1-ISP1 "iBGP"
SW2-ISP2 "iBGP"
there is cross link between SW1-SW2
Now SW2 have route from both ISP2 and and from ISP1 through SW1, so
weight is same, LP is same, Path is same .......until the lowest metric IGP and hence SW1 is direct connect to SW2 so it is lowest metric and select path through SW1 even if ISP2 is UP.
weight here is not effect WE MUST CHANGE LP in SW1 toward SW2.
when we change the LP toward SW1 and make it lowest than than toward ISP2 then we sure that traffic will go though ISP2 and as a backup will go through SW1 if ISP2 is DOWN.
Hope this answer your Q.
07-02-2021 09:04 AM
Hello @MHM Cisco World ,
the original poster explained that the two eBGP neighbors are terminated on a stack so SW1 and SW2 have to be considered a single device at L3 and so at BGP level.
Hope to help
Giuseppe
07-03-2021 03:39 AM
OK I see that he mention it Stack so I will check the solution again.
07-05-2021 05:52 AM
Hi
So now I see another issue in my lab when I shutdown BGP on Link one its fine it fails over instantly, but when I shut down the interface it takes a long time to re route to link 2 and back again when i re-enable the interface our timers are below
router bgp 64x.x.x
bgp log-neighbor-changes
timers bgp 10 30
---------------------------------
i can see ther are a couple of methods to change timer values, what is the bes method please and whats the shortest timers I can use ?
also will this need a bgp reset once the timers are changed.??
Thanks all
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