1

enter image description here

I have core1 and core2 router peer with same ISP but distinct hardware and they are sending us default route. currently all in/out traffic going over to core1 and core2 is idle (standby), I have iBGP running between core1 and core2 devices.

Question is some reason i am seeing some issue on core1 so trying to migrate traffic over core2 without any downtime or packet drops and this is what i did to do that but it didn't work, so what is wrong here and how i can make it possible?

core1(config)# route-map LOCALPREF permit 10
core1(config-route-map)# set local-preference 200
core1(config-route-map)#
core1(config-router)# neighbor XX.XX.XX.XX
core1(config-router-neighbor)# address-family ipv4 unicast
core1(config-router-neighbor-af)# route-map LOCALPREF in

I have tried to set weight 10000 also but that didn't work too

so how do i make my ebgp quick failover to core2?

here is my config (not complicated at all)

core1:

router bgp 403218
  router-id 192.168.255.20
  log-neighbor-changes
  address-family ipv4 unicast
    network XX.XX.XX.0/24
    redistribute static route-map RTBH
  neighbor XX.XXX.XXX.140
    remote-as 20742
    update-source loopback160
    ebgp-multihop 2
    address-family ipv4 unicast
      send-community
  neighbor 192.168.255.19
    remote-as 403218
    update-source loopback0
    address-family ipv4 unicast
      next-hop-self

core2:

router bgp 403218
  router-id 192.168.255.19
  log-neighbor-changes
  address-family ipv4 unicast
    network XX.XX.XX.0/24
    redistribute static route-map RTBH
  neighbor XX.XXX.XXX.141
    remote-as 20742
    update-source loopback160
    ebgp-multihop 2
    address-family ipv4 unicast
      send-community
  neighbor 192.168.255.20
    remote-as 403218
    update-source loopback0
    address-family ipv4 unicast
      next-hop-self
  • Whats the config on Core2? On Core1 you set the LP to 200 which is much higher than the default of 100, are you setting LP inbound on Core2? Please remember that setting this LP will only force the outbound path to switch, you will need to AS-PATH Prepend or use MED outbound to your provider to influence routes inbound. – ditrapanij Apr 30 at 23:16
  • I have pretty much same config on core2 with different neighbors IP and 192.168 is link between both core to run iBGP. So whatever I did is half part of story second was is to do AS PATH right? So what is the use of weight attribute here? Do you think shutting down bgp peer gracefully also quickly migrate traffic? – Satish Apr 30 at 23:52
  • Can you please edit your question to include the Core2 config so I can formulate a correct response. – ditrapanij Apr 30 at 23:53
  • Sure give me sometime, I’m far away from my laptop – Satish May 1 at 0:19
3

Modify your Local Preference inbound on the eBGP relationship to the ISP on Core2 to be greater than 100. You will also need to add a route-map to AS-PATH prepend your prefix to the eBGP neighbour on Core1 (To make the inbound traffic via Core2 look better).

At the moment you are modifying the Local Preference on Core1 to be higher than Core2 therefor, all outbound traffic within your iBGP will prefer the outbound routes via Core1. (Remember, higher LP is better!)

Core2:

route-map ISP-IN permit 10
 set local-preference 200

Core1:

ip prefix-list MY-SUBNETS permit x.x.x.x/x

route-map PREPEND-OUT permit 10
 match ip address prefix-list MY-SUBNETS
 set as-path prepend xxxx xxxx

Please make sure you're using prefix lists outbound!

| improve this answer | |
  • could you put that in command in your answer, that would be helpful, i think my mistake was i did local-pref on core1 instead of core2. Currently i have shutdown interface on core1 so BGP took around 90 sec to migrate traffic over to core2 but interesting thing when i bring up interface on core1 traffic automatically shifted back to core1 (even i removed all local-pref settings and make it defaults) Why does BGP always preferring core1 as best route? does my OSPF influencing BGP to make core1 prefer PATH (i have OSPF running between core to distribution switches in downstream. – Satish May 1 at 2:49
  • Lets say local-pref only influence outgoing traffic right, for example if i add 200 local-pref on core2 then my outgoing traffic will go out from core2 but incoming will still coming on core1 (am i right?) – Satish May 1 at 2:59
  • Added some sample configuration for route-maps into my response. Apply those to the relevant neighbours. But yes, your last statement is correct. – ditrapanij May 1 at 3:33
  • can set as-path prepend XXX XXX this can be any arbitrary numbers right? – Satish May 1 at 4:32
  • Negative, that needs to be your AS. – ditrapanij May 1 at 4:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.