cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
936
Views
5
Helpful
3
Replies

static routes :: floating routes

Hi All,

Is it possible to make a static route with defaults (AD and metric) as primary route and the dynamic route the secondary. But when the next hop of the static route is not available it should use the dynamic routing. Is it possible to acheive? If yes, please help with documentation.

Regards,

Ravi

2 Accepted Solutions

Accepted Solutions

cadet alain
VIP Alumni
VIP Alumni

Hi,

default AD of static route is 1 and any IGP and BGP all have an AD > 1 so yes it is possible.

you would have to track the next-hop  using IP SLA and the command ip route x.x.x.x x.x.x.x track x

Don't forget though that  AD or metric are only taken into account when comparing equal longest match routes.

http://www.cisco.com/en/US/docs/switches/lan/catalyst3750x_3560x/software/release/12.2_55_se/configuration/guide/sweot.html

Regards.

Alain

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

View solution in original post

Peter Paluch
Cisco Employee
Cisco Employee

Hello Ravi,

Yes, such thing is possible using the IP SLA feature. Basically, you perform a test of rechability of the next hop using ordinary pings. If these pings fail, the route will be declared unusable even though the egress interface appears to be alive. That will allow the dynamic route to enter the routing table.

Assume that you are configuring this for a static route towards 10.0.0.0/8 and the next hop is 192.0.2.2 on your Fa0/0 interface. The complete setup would be:

ip sla 1 ! The IP SLA operation is defined here

icmp-echo 192.0.2.2

  frequency 10 ! The 192.0.2.2 is pinged each 10 seconds

  threshold 500 ! Pings over 500msec are considered delayed

  timeout 1000 ! Pings over 1000msec are considered timeouted

!

ip sla schedule 1 start-time now life forever ! The SLA operation is scheduled to run indefinitely

!

track 1 rtr 1 reachability ! Track object 1 will hold the result of the IP SLA 1 operation

!

ip route 192.0.2.2 255.255.255.255 FastEthernet0/0

ip route 192.0.2.2 255.255.255.255 Null0 2

! The previous two lines make sure that the 192.0.2.2 is either reached via Fa0/0 or is never reached

! This is to prevent successfully pinging 192.0.2.2 via some detour

ip route 10.0.0.0 255.255.255.0 192.0.2.2 track 1

Now, if the track object 1 stores a successful result from the IP SLA 1 operation, the track 1 test on the static route is met, and the route is eligible to be installed into the routing table just like any other static route (other requirements for a static route to be installed into the routing table must still be met, like the next hop of 192.0.2.2 being resolvable to an egress interface). If the IP SLA 1 operation fails, the track 1 test on the static route is not met, and the route will be considered unusable and removed from the routing table at once, allowing the dynamically learned route to enter the routing table instead. If the IP SLA 1 operation becomes successful again, the route will be reinstated into the routing table.

Best regards,

Peter

View solution in original post

3 Replies 3

cadet alain
VIP Alumni
VIP Alumni

Hi,

default AD of static route is 1 and any IGP and BGP all have an AD > 1 so yes it is possible.

you would have to track the next-hop  using IP SLA and the command ip route x.x.x.x x.x.x.x track x

Don't forget though that  AD or metric are only taken into account when comparing equal longest match routes.

http://www.cisco.com/en/US/docs/switches/lan/catalyst3750x_3560x/software/release/12.2_55_se/configuration/guide/sweot.html

Regards.

Alain

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

Peter Paluch
Cisco Employee
Cisco Employee

Hello Ravi,

Yes, such thing is possible using the IP SLA feature. Basically, you perform a test of rechability of the next hop using ordinary pings. If these pings fail, the route will be declared unusable even though the egress interface appears to be alive. That will allow the dynamic route to enter the routing table.

Assume that you are configuring this for a static route towards 10.0.0.0/8 and the next hop is 192.0.2.2 on your Fa0/0 interface. The complete setup would be:

ip sla 1 ! The IP SLA operation is defined here

icmp-echo 192.0.2.2

  frequency 10 ! The 192.0.2.2 is pinged each 10 seconds

  threshold 500 ! Pings over 500msec are considered delayed

  timeout 1000 ! Pings over 1000msec are considered timeouted

!

ip sla schedule 1 start-time now life forever ! The SLA operation is scheduled to run indefinitely

!

track 1 rtr 1 reachability ! Track object 1 will hold the result of the IP SLA 1 operation

!

ip route 192.0.2.2 255.255.255.255 FastEthernet0/0

ip route 192.0.2.2 255.255.255.255 Null0 2

! The previous two lines make sure that the 192.0.2.2 is either reached via Fa0/0 or is never reached

! This is to prevent successfully pinging 192.0.2.2 via some detour

ip route 10.0.0.0 255.255.255.0 192.0.2.2 track 1

Now, if the track object 1 stores a successful result from the IP SLA 1 operation, the track 1 test on the static route is met, and the route is eligible to be installed into the routing table just like any other static route (other requirements for a static route to be installed into the routing table must still be met, like the next hop of 192.0.2.2 being resolvable to an egress interface). If the IP SLA 1 operation fails, the track 1 test on the static route is not met, and the route will be considered unusable and removed from the routing table at once, allowing the dynamically learned route to enter the routing table instead. If the IP SLA 1 operation becomes successful again, the route will be reinstated into the routing table.

Best regards,

Peter

thank you. It helps.

Cheers!

Ravi

Review Cisco Networking for a $25 gift card