cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
16430
Views
0
Helpful
30
Replies

IP SLA and BGP

jonesl1
Level 1
Level 1

Hello All,

Needing some assistance with an IP SLA setup that I'm having some issues wrapping my head around.     I have a router that has two connections to a remote site router.    One connection from HQ-Rtr has a serial connection to an MPLS cloud using BGP as it's routing protocol.   The other connection is an Ethernet connection to an ASA (which uses an IPSEC tunnel to the remote router).    Here is what I'd like to do.   I'd like to use the MPLS cloud connection as the primary connection.  Once it fails, I would want the Ethernet connection to the ASA to kick in.   However, I would like it to fall BACK over to the MPLS cloud connection in the event that the Serial connection comes back online.    

 

With that said, I know I'll have to use IP SLA to make this work but I'm running into an issue getting it to fall BACK to the primary route.  I'm not sure why.     I'm basically doing the following:

       track 1 ip sla 1 reachability

       ip sla auto discovery
           ip sla 1
                icmp-echo a.a.a.a source-interface Serial1/0
                request-data-size 32
       ip sla schedule 1 life forever start-time now

 

       ip route 1.1.1.0  255.255.255.0  x.x.x.x track 1  (learned via bgp from cloud, metric 20)

       ip route 1.1.1.0  255.255.255.0  y.y.y.y 25

 

So, to me.....this says as long as I can ping a.a.a.a from source int s1/0, the route for network 1.1.1.0 should go to x.x.x.x.   Then once it fails, it falls over to y.y.y.y.   It requires the 25 cost so that it doesn't take precedence over the x.x.x.x route.    Am I seeing this correctly so far?   Then once x.x.x.x comes back online, it SHOULD fall back over to that one being it has the lower cost route of 20.   Is this right?   

 

Well regardless it's not working quite as expected so someone had mentioned something about setting another IP SLA up with a 'Boolean and' statement.   I'm not 100% sure about this so if anyone can explain this to me and how it would work in the above scenario or why it would be done, then that would help also.   Here is what they suggested:

      track 2 list boolean and
         object 1 not

and to change my routes to look like the following:

       ------Remove route for x.x.x.x all-together-------

       ip route 1.1.1.0  255.255.255.0  y.y.y.y track 2

I'm guessing (and I do mean guessing) this says to monitor track 1 and if track 1 is NOT true (false) then apply the route for y.y.y.y? 

Can someone take a look and help me with the concept, I guess maybe I'm in left field here but I'm struggling a bit on making this work.  

Thanks in advance,

     

1 Accepted Solution

Accepted Solutions

Okay I think the issue is this.

You are redistributing statics into BGP. So what happens is that when your MPLS link is up you receive the loopback via BGP and it has an AD of 20 so goes into the IP routing table because it has a better AD.

When the MPLS link fails your static route with an AD of 200 is placed into the IP routing table and redistributed into BGP.

When the MPLS link comes back up your router receives the same route from the PE router.

Now your MPLS router has two routes in BGP for the same destination and prefix.

The one from the PE has a weight of 0 but the static that was redistributed locally has a weight of 32768 because that is the weight assigned to locally generated routes.

The higher the weight the better so BGP sticks with the route via the ASA.

The usual solution to this is to modify the routes received from the PE so they have a weight > 32768 and so once the MPLS link comes back up they are preferred and installed in the IP routing table.

You can do that as a test if you want however you are just unfortunate in that you have hit this issue with your test because in production it wouldn't occur.

The reason being you would have a summary route or default static route pointing to your ASA so the more specific routes via MPLS are always used if they are available.

Hope that makes sense.

Jon

View solution in original post

30 Replies 30

Jon Marshall
Hall of Fame
Hall of Fame

Why do you need IP SLA ?

IP SLA is usually used when you need to track a static route.

But you are using BGP on the MPLS link.

If you receive a default route from BGP then simply configure a static default route with an AD > 20 pointing to the ASA

If you don't receive a default route from BGP and you don't have local internet connectivity in that site just configure a static default route pointing to the ASA.

Either way if the MPLS link fails then you don't receive BGP routes any more so your default route is used and if the link comes back up you go back to MPLS.

The only downside is that BGP can take up to 3 minutes before it realises a neighbor is down and stops advertising routes but that is dependant on the timers ie. they can be reduced if the SP agrees to it.

But you also mention you are connected to MPLS via serial so if the other end went down your router would know about it immediately and remove the BGP routes.

Jon

Hey Jon!   Thanks for responding.

So I've tried that and it fails over just fine....very fast actually.....but for some reason I can never get it to fall back.   I've waited quite a while to have it fall back over, but its like it won't.   I've set my cost on my route to be 200 to make sure that it was >20.    Does the backup link HAVE to fail in order for it to fall back?    In the production scenario the backup is a cellular link and obviously we want to try and not use that as much as possible and that's why even though the cellular is up, I'd rather fall back to MPLS if its working.  

As soon as your router gets the BGP routes again it should prefer those and stop using the ASA.

It may be something to do with your configuration.

The backup link doesn't have to fail.

Is the internal interface of the router for the LAN and the inside interface of your firewall in the same IP subnet and if so what is the default gateway of the clients ?

Jon

The internal interface of the ASA is just a point to point (255.255.255.252) to which I have connected to the router I'm trying to perform the routes on.   For instance:

This would be the router:

int g0/0

   ip address 192.168.10 6   255.255.255.248

 

int g0/2

   ip address 192.168.10.225   255.255.255.252  

 

ASA would have an internal interface of 192.168.10.226.   There is no default route assigned on this network.   Basically statically mapping each subnet.     So right now I'm just routing the loopback IP to test with.   

Hopefully that makes sense.

 

Okay, so there are no clients currently on the network ?

So when the MPLS link comes back up what does the IP routing table look like ?

I assume the BGP routes are covering all the remote networks from your other sites and you are pinging one of those IPs ?

Jon

Yes.   No clients, just routing to other networks. 

So it failed over to the backup link (cellular) and stayed there.  I looked at the bgp routes in the router and the bgp route for the remote loopback, which is what I'm pinging, is not there.  However,  If I remove the static route to the asa with the cost 200, it immediately pops back in the table and shifts back over to the primary route like it should.  It's like it's not seeing the BGP route until I remove that static.  

Yes the BGP routes are covering all the remote networks and I am pinging one of them. 

Is the route you are adding to the ASA a specific route for the remote IP you are pinging or a default route ?

Jon

Host route to the Loopback IP address

Okay, if the route received by BGP is the same prefix and mask then the BGP route should replace it.

But it would have to be for the same prefix and more importantly mask.

But that aside you don't need to do this. You simply configure a static default route pointing to the ASA.

Your router will always choose the more specific routes and as long as the MPLS link is up you will have those via BGP.

If the link fails your router will fall back to the default route.

Jon

So if I disable the loopback on the remote router, I guess the serial interface of that remote router will continue to advertise that loopback route via BGP if it's still up (since it's still in the router bgp 12345 instance)?

When you say disable do you mean not have a static route for it ?

Sorry not clear on what you mean ?

Jon

Sorry, I mean just do a shutdown on the loopback interface.

 

I just tried it and it seems like if I shutdown the loopback interface and then look at the central side router (where I'm doing the failover routing also the other end of the MPLS cloud), the bgp route doesn't show up any longer.  Once I enable it again, it shows up   Does this sound correct?

If you shut the interface down it should no longer be advertised into BGP.

Apologies but you have totally lost me now :-)

Your MPLS routers should be advertising routes for their respective LAN subnets and any loopbacks for testing.

On the same MPLS router you just need a static default route or a summary address pointing to the ASA.

Is the central site setup the same way.

Do you have any L3 switches anywhere , are you doing any redistribution from or into BGP ?

Jon

I'm sorry.  I know it's confusing.   It's kind of a special case and I'm doing a half test in production.   Ultimately here is what I have.   I have a router at one of our remote locations and it has a loopback interface on it.    This router, we will call Router A.    Router A is in production.     It has a serial connection to MPLS and then it's local network.    His loopback IP address is x.x.1.164.

I'm trying to test with another router sitting here at my desk, we'll call router B.  This device is set up the same (regarding IP's) as Router A as Router A will eventually be replaced with Router B.   Router B's loopback is also x.x.1.164.  This router has a cell card and also a Serial connection (however I can't use the serial because I don't have the circuit hear at my desk).

Then I have the router at the central side which I'm doing my routing from that I've been trying to work out.    So what I was doing was 'shutting down' the loopback on Router A (production) and attempting to get the routes to shift over in order to use the cell card (Router B) through the asa connection.

Meanwhile I'm trying to do this while not taking down anything important on the production router, hence the loopback.  :) 

Maybe this makes more sense.    That's why I said, when I shutdown the loopback, I was referring to shutting down the loopback on the production router (Router A).   I realize that wouldn't make sense after I sent it.  :(  Sorry about that.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: