09-16-2014 05:05 PM - edited 03-04-2019 11:46 PM
I have 2 ISP's with 2 separate routers. 1 - 3845 and 1 - 2801. The routers are connected to a 2900 Catalyst switch stack on the LAN side. My Goal is to have BGP "follow" HSRP. When HSRP fails over I would like BGP to failover as well. Currently if I test failure of the LAN interface on the master router, HSRP works correctly but BGP fails to route traffic.
I have attached modified examples of the configs from both routers.
09-17-2014 12:16 PM
Hi Gary,
Suppose router_a connects to ISPA; router_b connects to ISPB. Is your goal to have router_a bring down its eBGP session with ISPA if router_a is no longer the HSRP active router?
If so, I don't think there's a native way to do this, however, you may be able to use EEM scripts to bring down the session.
See this article: http://notalwaysthenetwork.com/2014/02/05/monitoring-hsrp-failover-with-eem/
The solution depends very much on your goals. Post a topology and the results of your testing...
09-18-2014 04:54 AM
j0nelsonCCNA,
Thanks for the response.
You are correct with your assumption. I will look into EEM scripts.
I have also found other options from my research. Would it be possible to:
- On router_a create an IP SLA process which starts PINGing the eBGP peer every 5 seconds.
- Next create an object which tracks this process.
- Next create a /32 static route to the peer using the peer itself as the next hop which uses the object status to validate itself.
- Next create a prefix to match this route.
- Then create a route-map which matches the prefix-list.
- Add this command to BGP “neighbor x.x.x.x fall-over route-map PEER_REACHABLE”
- Add a tracking statement to track the same object created above for BGP failover
Or is it possible to create loopback addresses and use iBGP?
Thanks
09-18-2014 05:47 PM
Gary,
Some commentary on your other solutions:
The problem with this solution is that if router_b goes down hard, router_a kills the BGP session and the entire site goes down. In other words, you fate-share the ISP connections which may not be what you want.
The reason I said there's no "native" way to do it is because under every scenario where you track the liveness of router_b ( i.e. IP SLA, Route injection/withdrawal, etc.), when router_b goes down or the path to router_b goes down, you end up unnecessarily bringing down the site ( by killing router_a eBGP session). I doubt you can justify the site going down, when you have redundant hardware/ISPs.
The problem is that from router_a's perspective you can only safely kill the BGP connection under a narrow set of circumstances:
My #2 occurs if the path to router_b could be through N intermediate switches. If the link between two of these intermediate switch goes down. In this case, from a LAN perspective you have split-brain operation of the HSRP VIP. This means that you have a MAC flap. It may mean degrade service from an end-user perspective but at least they don't go down hard.
Can you post your topology. Don't need specifics, I just need to know how things are connected. Also are you running eBGP for a L3VPN (WAN) or is this for your Internet presence?
09-19-2014 07:51 AM
09-19-2014 11:44 AM
j0nelsonCCNA,
Ok, what if I leave the IP SLA tracking of the external address. Then on router_b add a IP SLA to track the external interface of my firewall (VIP).
ip sla 2
icmp-echo 5.5.5.5 source-interface GigabitEthernet0/1
timeout 500
threshold 40
frequency 3
ip sla schedule 1 life forever start-time now
Then I add EEM script to shutdown the external interface.
event manager applet SHUTDOWNEXTERNAL
event track 2 state down
action 1.0 cli command "enable"
action 1.1 cli command “config t”
action 1.2 cli command “interface gigabitethernet 0/0”
action 1.3 cli command “shutdown”
action 1.4 cli command “exit”
Then when track 2 is available again I use another EEM script to bring the interface back up.
event manager applet NOSHUTDOWNEXTERNAL
event track 2 state up
action 1.0 cli command "enable"
action 1.1 cli command “config t”
action 1.2 cli command “interface gigabitethernet 0/0”
action 1.3 cli command “no shutdown”
action 1.4 cli command “exit”
If this works, do I need to do anything on router_a?
Thanks
09-20-2014 01:05 PM
Gary,
Now that your topology is in, the solution is a bit more obvious, here's what I would do:
LAN Side Failover
Internet Side Failover ( Conditional BGP Announcement )
This should solve your problem because of the way you have things physically connected setup:
That should just about do it. Let me know if you need a config example and I can provide you one based on the configs you gave.
Let me know your thoughts...
Joe
09-21-2014 04:25 AM
I like the solution. A config example would be very helpful if you don't mind.
Thanks,
Gary
09-21-2014 06:58 PM
@Gary,
See attached document. Some disclaimers:
One last thing. It occurred to me: What happens in this scenario:
You get a blackhole for your site prefixes. This is because router_b still does not advertise your site prefixes because it still has the ISPA connected /30 in is BGP RIB. The workaround is to condition the announcement on the existence of prefixes originated from ISPA directly ( see doc). If you don't have such routes, you don't have a direct connection to ISPA and that verifies that router_a is no longer a viable ingress/egress point.
I'll make one last commentary: All these mechanisms -- EEM scripts, BGP conditional announcement, IP SLA tracking, etc-- add complexity. Not strictly a bad thing, but I like to keep things simple and avoid turning knobs where possible. That said, you wouldn't have to go through these theatrics to cover the failure cases if you had a direct link between router_a and router_b, I would seriously consider making it so.
If you can't spring for an EHWIC, you could recreate your edge network by connecting both interfaces on your edge routers to the 2960S. Both ISPs would connect to either 2960S switch. Logically, you establish a full mesh eBGP sessions between your routers and your ISPs. But that's just trading one complexity for another. I'd spring for the EHWIC and add a link between your routers...
Mark if you find helpful. Come back and show me your results as well...
09-21-2014 07:02 PM
Also, see the link on BGP cond advertisement:
http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/16137-cond-adv.html
09-23-2014 09:56 AM
Gary,
Did you find that configuration example helpful?
02-03-2016 05:21 AM
I know it has been over a year, but I wanted to let you know that I found this post very helpful.
Thanks for the effort you put in.
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