cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1895
Views
5
Helpful
11
Replies

Administrative distance for static route

dumble4me
Level 1
Level 1

Hi,

I have a doubt regarding static route. I just went through one document for which the link is given below.

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094195.shtml

As per the above document static routes pointing to next-hop ip address will have administratice distance of 1 and those pointing to outgoing interface is having administrativedistance of 0. But this is not case when I tried to configure.

I have a directly connected multilink and I am configuring a static route pointing to this multilink.

RINCHNLKB-2A-1750#sh ip int brief

Multilink1 192.168.45.30 YES NVRAM up up

RINCHNLKB-2A-1750(config)#ip route 20.0.0.0 255.255.255.0 multilink 1

RINCHNLKB-2A-1750(config)#^Z

RINCHNLKB-2A-1750#sh ip route | include 20.0.0.0

20.0.0.0/24 is subnetted, 1 subnets

S 20.0.0.0 is directly connected, Multilink1

RINCHNLKB-2A-1750#sh ip route 20.0.0.0 255.255.255.0

Routing entry for 20.0.0.0/24

Known via "static", distance 1, metric 0 (connected)

Routing Descriptor Blocks:

* directly connected, via Multilink1

Route metric is 0, traffic share count is 1

Now you can see that AD for this route is 1 instead of 0. Can somebody throw some light into this ?

Thanks,

Pete

11 Replies 11

saimbt
Level 1
Level 1

Hi Pete,

For static route

AD for the next hop IP address is 1

AD for the is 0

As stated above,

If you use the next hop interface address in a static route the metric is chosen as 1.

if Outgoing interface is used, then the metric chosen is 0

HTH

Narayan

Jon Marshall
Hall of Fame
Hall of Fame

Hi

This is an interesting question. I did a quick test in our lab

ip route 192.168.5.1 255.255.255.255 172.16.7.46

** 172.16.7.46 is the other end of P2P link.

ip route 192.168.6.1 255.255.255.255 fa0/1

** fa0/1 is this end of the p2p link ie 172.16.7.45

When you show the routes individually you get the following

RT-PPTE-IXE-WR1#sh ip ro 192.168.5.1

Routing entry for 192.168.5.1/32

Known via "static", distance 1, metric 0

Routing Descriptor Blocks:

* 172.16.7.45

Route metric is 0, traffic share count is 1

RT-PPTE-IXE-WR1#sh ip ro 192.168.6.1

Routing entry for 192.168.6.1/32

Known via "static", distance 1, metric 0 (connected)

Routing Descriptor Blocks:

* directly connected, via FastEthernet0/1

Route metric is 0, traffic share count is 1

From this output it suggests both have a distance of 1.

When i do a sh ip ro static

RT-PPTE-IXE-WR1#sh ip route static

192.168.5.0/32 is subnetted, 1 subnets

S 192.168.5.1 [1/0] via 172.16.7.45

192.168.6.0/32 is subnetted, 1 subnets

S 192.168.6.1 is directly connected, FastEthernet0/1

As you can see 192.168.5.1 has an AD of 1 whereas 192.168.6.0 does not have an AD associated with it which i guess means an AD of 0.

I'm not sure what is happening here. Perhaps someone else can explain.

Jon

Static routes in Cisco IOS are by default installed with an administrative distance value of 1. A common misunderstanding is that static routes configured via interfaces are installed with an AD of 0, like interface routes. This is not true. No routing source except Connected can install routes with this AD. The reason for this misunderstanding is that static routes over interfaces are treated as directly connected routes, but that doesn't make them have an AD of 0.

Hi

I think this is where the confusion has arisen from because the link that the original poster referred to does state that a static route configured via an interface is given an AD of 0.

The sh ip ro static output from previous post would also suggest that the static route via an interface does not have an AD of 1.

The two outputs seem to conflict each other. I think that's where the confusion lies (certainly for me ! )

Jon

Hi all

Can anybody explain this.

Jon

Jon

The output of show ip route static does not give information as complete as you may think.

When i do a sh ip ro static

RT-PPTE-IXE-WR1#sh ip route static

192.168.5.0/32 is subnetted, 1 subnets

S 192.168.5.1 [1/0] via 172.16.7.45

192.168.6.0/32 is subnetted, 1 subnets

S 192.168.6.1 is directly connected, FastEthernet0/1

As you can see 192.168.5.1 has an AD of 1 whereas 192.168.6.0 does not have an AD associated with it which i guess means an AD of 0.

I'm not sure what is happening here. Perhaps someone else can explain.

If you do show ip route 192.168.6.1 255.255.255.255 I believe that the output will show that the route has administrative distance of 1.

I believe that the functional difference between static routes to an interface or static routes to a next hop address is in whether a dynamic routing protocol network statement will match the route. I believe that you would find that if you put a network statement under your dynamic routing protocol for 192.168.6.0 that the protocol would advertise the network without requiring redistribute static.

HTH

Rick

HTH

Rick

Hi Rick

In another part of my post i do a "sh ip route 192.168.6.1" and it does indeed show an admin distance of 1.

I was just a little unclear as to why i was seeing different things in the output. The answers that the original poster had received up to that point had been a bit unhelpful in that they didn't really address the issue at all.

Jon

Pramod is exactly correct. No static route will ever have administrative distance of 0. Static routes are always administrative distance of 1 (unless you configure floating static). I know that there are many articles and books that say otherwise (many written by people at Cisco - who you would think should know) but these articles and books are wrong. It is good advice that when in doubt about what an article or book says, to go to a router and see what it does. Several people have done that for this discussion and their evidence is quite convincing.

This topic has been discussed several times in these forums and the answer is that no static route will have administrative distance of 0.

HTH

Rick

HTH

Rick

bvsnarayana03
Level 5
Level 5

AD is always 1 for static route, though metric changes based on whether you point it to directly connected interface or next-hop.

I agree with the above poster that only the metric changes and not the AD and i had posted the same thing earlier but didn't explicitly state that the AD will not chnage but the metric will.

Also if you configure 2 static routes, one poiting to the next-hop and the other to an interface, the route pointing to the interface is always entered into the routing table.

HTH

Narayan

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