Showing results for 
Search instead for 
Did you mean: 
Join Customer Connection to register!

Administrative distance for static routes

Hi everyone!

Question is: how to change administrative distance for the static route,

witch uses as the next hop directly connected interface?

Why I need this?

I have primary WAN interface, with ip route track 1

and Secondary 3G GSM BACKUP interface with ip route cellular 0/0/0.

I'm tracking WAN for reachability using ping. And when ping cant reach the destination through primary

interface then cellular 0/0/0 goes up and takes his role.

Problem is that when WAN link goes back online cellular interface has better adm. distance,

than primary and it cant take over his primary role back.

Any help is welcome!



Thank you Massimiliano,

But I can't still find the answer on my question.




Hi Aleksei,

You need to add an administrative distance to the backup default static route. For example:

ip route track 1

ip route cellular 0/0/0 254

When the primary link is up, IOS will choose the first static route, because the administrative distance is better.

When IP SLA notifies that the link is down IOS will remove the route from the routing table. Hence the static route via cellular interface will be used (it will be the only one available).

When the primary link comes back, the static route will be add again to the routing table, and it will have a better distance than the other, hence it will take over.

Let me know if this answers your question.



Hi Marco,

I have tried it a lot of times at the begining.

With command ip route cellular 0/0/0 254 in routing table appears output shown below:

S* is directly connected, Cellular0/0/0

Administrative distance is remained the same - zero.

When users traffic dont pass this interface within the dialer idle-timeout value, then Cellular interface changes it's link state to down and this line will appear in the routing table.

S* [1/0] via

Note, that when WAN link is back online IP SLA tries to ping the specified IP through this port.

In case when Cellular interface is used by users and WAN interface is back online IP SLA returns me Timeout message and tracking primary route is remained to be down.

Please help, i'm getting sick of this backup


Cellular 0/0/0 254 have higher priority than 10.x.x.x 1, because it is directly connected.


Can you try backup interface command

Create a tunnel , track the tunnel instead of sla make cellular interface as backup interface .

Sent from Cisco Technical Support iPhone App

once you define interface in your static route it will be treat like a connected interface

if you can not use a next hope IP

then this will be an issue

one trick you could do is creat another track IP sla and associted with the secondary static route

this one check if the track 1 is up then it goes down if track 1 is down then it goes up

in this case case when the the primary interface come back online track one wil lbecome up and then track 2 will go down !!

config example ( please check the comifg based on your ios version as they sometimes slightly diffrent !! )

ip sla 1

icmp-echo source interface {ur primary interface]

timeout 500

frequency 3

ip sla schedule 1 life forever start-time now

track 1 rtr 1 reachability



track 2 list boolean and

object 1 not

ip route track 1

ip route cellular 0/0/0 track 2

please confirm it and let us know

good luck

if helpful rate

paul driver
VIP Mentor

" I have tried it a lot of times at the begining.

With command ip route cellular 0/0/0 254 in routing table appears output shown below:

S* is directly connected, Cellular0/0/0

Administrative distance is remained the same - zero."

Specify the exit interface plus the next hop address, this will not only stop this route being advertised as  directly connected it will also only minimizies table lookups on the next hop interface and reduce  the arp cache entries.



kind regards

Please rate and mark posts accordingly if you have found any of the information provided useful.
It will hopefully assist others with similar issues in the future

Thank you all for replies.

To marwanshawi.

This wont work, because IP SLA cant ping through WAN interface while Cellular interface is UP. Why? I have no idea.

It just sends to track 1 timeout message.

When Cellular interface idle-timeout expires (which is impossible if users are active and use 3g as a backup), then IP SLA can finnaly ping through WAN interface fa 0/0 and track shows state is up.

To pdriver.

Unfortunatelly I can't specify next hop address, because my 3G provider provides me with a new IP and new Gateway each time I connect to 3G network, also IP is from different subnet, than gateway (IP 46.x.x.x GW 217.x.x.x)..