cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2297
Views
10
Helpful
27
Replies

Static Route Tracking (Primary and Backup Static Routes)

AMU
Level 1
Level 1

Dear All,

               I am looking for a solution for the following scenario. Any help in this regard would be highly appreciated.

There is one service running on servers which has additional virtual IP (30.30.30.1/30) which could be active on Site A or Site B at any given time but not on both sides at the same time.  I need  to use static routing on my "Layer 3 Device" which is connected to both Site A and Site B.  I need to enable static route tracking to find out whether this Virtual IP is active on Site A or Site B and then somehow automatically change the routing table entry in the  "Layer 3 Device" i.e.

If Virtual IP is active on Site A,      

route via  Site A Switch HSRP  Gateway  

otherwise

route via Site B Switch HSRP  Gateway

is installed in the routing table.  I know about IP SLA feature but i think i can't use SLA feature in this scenario.  What options can I use in this scenario.

 

StaticRouteTracking.jpg

 

Thanks in advance.

 

Regards,
AMU

27 Replies 27

Hello,

 

if your layer 3 device is a Cisco device, you could use the IP SLA below. If 30.30.30.1 cannot be reached via Site A, the secondary route via Site B will be used:

 

Layer 3 Device

 

interface GigabitEthernet0/0
description Link to Site A
!
interface GigabitEthernet0/0
description Link to Site A
!
track 1 ip sla 1 reachability
!
ip sla 1
icmp-echo 30.30.30.1 source-interface GigabitEthernet0/0
frequency 5
!
ip sla schedule 1 start-time now life forever
!
ip route 30.30.30.0 255.255.255.252 GigabitEthernet0/0 track 1
ip route 30.30.30.0 255.255.255.252 GigabitEthernet0/1 200

Thanks for your Answer Georg,    I have already tried IP SLA but it is not working in my scenario because I am not tracking the reachability for gateway/nexthop IP but the address itself 30.30.30.1/32. 

 

 

Hello,

 

the configuration I posted does exactly that: it tracks the reachability of 30.30.30.1 on Site A. If 30.30.30.1 cannot be reached on Site A, traffic for that virtual IP will go to Site B. 

 

Maybe I misunderstand your setup...

Hello


@AMU wrote:

 

There is one service running on servers which has additional virtual IP (30.30.30.1/30) which could be active on Site A or Site B at any given time but not on both sides at the same time. 


So why do you need static routing? -How is this server active on either either site, How is it addressing currenlty being advertied by either site

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Hi Paul,

I can't  use dynamic routing on this "Layer 3 Device". The Servers1/2 and Switches 1/2 are OSPF capable and as soon as this address is active on either site, they are propagated through the OSPF to the Switches1/2 on relevant site.

 

Thanks,

AMU 

Hello

Apologies here - but it still doesn’t verify your topology

you show a L3 device in between two sites so your not extending you lans across each site but each site has dynamic routing active 

Unless u am looking at the the wrong way around and given your topology- how can a server reside in both sites and have the same vip  - are you using virtualisation (lisp) etc ?? 

 

Or is it this server is upstream from both sites only accessible via the L3 device


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Hi Paul,

               Switches 1/2 are and Servers1/2 are running OSPF.  The VIP 30.30.30.1/32 is active and available On Server1/2 by an application but either on Site A or Site B at any given time. To explain the scenario, Say be default the VIP is active and available on Site A. Static Routing  on "Layer 3 Device"

 

192.168.10.0/24 via 192.168.10.X (HSRP IP on Switches 1/2,  GW)  Site A

192.168.20.0/24 via 192.168.20.X (HSRP IP on Switches 1/2,  GW)  Site B

30.30.30.1/32 via   192.168.10.X            (in case it is available on Site A, need to somehow track whether it still available through Site A GW  192.168.10.X)

 

If there is some issue with Site A Servers than the site Failover  is performed. The VIP is not available for some time say 5 minutes but then It is active and available now on Site B.  Static Routing  on "Layer 3 Device" should automatically now adopt to

192.168.10.0/24 via 192.168.10.X (HSRP IP on Switches 1/2,  GW)  Site A

192.168.20.0/24 via 192.168.20.X (HSRP IP on Switches 1/2,  GW)  Site B

30.30.30.1/32 via   192.168.20.X            (Adapted the routing entry to Site B, need to somehow track further whether it still available through Site B GW  192.168.20.X, another Site Failover may occur and it will be again available at Site A and we need to adpot the routing again to first scenario)

 


Thanks and Best  Regards,
AMU

 

 

Hello,

 

I am just thinking, why not use two IP SLAs, and if one is down, after a delay of 360 seconds (or whatever value you need), an EEM script installs a default route towards the other site. It would look like this:

 

 

interface GigabitEthernet0/0
description Link to Site A
!
interface GigabitEthernet0/1
description Link to Site B
!
track 1 ip sla 1 reachability
track 2 ip sla 2 reachability
!
ip sla 1
icmp-echo 30.30.30.1 source-interface GigabitEthernet0/0
frequency 5
!
ip sla schedule 1 start-time now life forever
!
ip sla 2
icmp-echo 30.30.30.1 source-interface GigabitEthernet0/1
frequency 5
!
ip sla schedule 2 start-time now life forever
!
ip route 0.0.0.0 0.0.0.0 ip_address_site_A

event manager applet TRACK_VIP_DOWN
event timer countdown time 360
event track 1 state down
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "no ip route 0.0.0.0 0.0.0.0 ip_address_Site_A
action 4.0 cli command "ip route 0.0.0.0 0.0.0.0 ip_address_Site_B
action 5.0 cli command "end"

 

event manager applet TRACK_VIP_UP
event timer countdown time 360
event track 1 state up
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "no ip route 0.0.0.0 0.0.0.0 ip_address_Site_B
action 4.0 cli command "ip route 0.0.0.0 0.0.0.0 ip_address_Site_A
action 5.0 cli command "end"

Hi Georg,
I was also thinking in this direction, combination of IP SLA and EEM. Will try your solution and let you know. Thanks.

Hello @Georg Pauwen 


@Georg Pauwen wrote:

interface GigabitEthernet0/0
description Link to Site A
!
interface GigabitEthernet0/1
description Link to Site B
!
track 1 ip sla 1 reachability
track 2 ip sla 2 reachability
!
ip sla 1
icmp-echo 30.30.30.1 source-interface GigabitEthernet0/0
frequency 5
!
ip sla schedule 1 start-time now life forever
!
ip sla 2
icmp-echo 30.30.30.1 source-interface GigabitEthernet0/1
frequency 5
!
ip sla schedule 2 start-time now life forever
!
ip route 0.0.0.0 0.0.0.0 ip_address_site_A

event manager applet TRACK_VIP_DOWN
event timer countdown time 360
event track 1 state down
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "no ip route 0.0.0.0 0.0.0.0 ip_address_Site_A
action 4.0 cli command "ip route 0.0.0.0 0.0.0.0 ip_address_Site_B
action 5.0 cli command "end"

 

event manager applet TRACK_VIP_UP
event timer countdown time 360
event track 1 state up
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "no ip route 0.0.0.0 0.0.0.0 ip_address_Site_B
action 4.0 cli command "ip route 0.0.0.0 0.0.0.0 ip_address_Site_A
action 5.0 cli command "end"


How can you have default routes on the single L3 device that interconnects both of these routing domains when the two sites also have default routes pointing the the L3 devcie -Surely this incur a loop would it not?



 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Hello Paul,

 

not sure what you mean, how would the loop occur ? At any given time, there would be only one default route on the layer 3 device. That default route would point to the site where the VIP is active.

 

Either way I cannot test it, better ask the OP...


@Georg Pauwen wrote:

Hello Paul,

 

not sure what you mean, how would the loop occur ? At any given time, there would be only one default route on the layer 3 device. That default route would point to the site where the VIP is active.

 


Site X default route <> L3 device default route to site X ??(Outch) !


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Hi Georg and Paul,
Site A/B switches have a default route to Layer 3 Device and Layer 3 Device have site specific static routes to Site A and Site B networks plus the VIP static routes. For external networks there is a default route to the one level above. No loop.
Thanks.

Hello

I understand that’s why I was querying the EMM example @Georg Pauwen  provided as has it had defaults pointing to your sites


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul
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:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco