cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3237
Views
15
Helpful
25
Replies

Need explaination about static routes

Hi All,

As we all have read and know that by default AD of static route (with next hop IP) is 1 and AD will be 0 if directly connected.

However, I was playing with these and found that Routing table inserts both  the routes with same AD, i.e. AD 1.

Below is my sample which i was experimenting with.

R1 is connected to R2

R1 fa0/0 connected to R2 fa0/0

R2 fa0/1 connected to R2 fa0/1

Configs as below:

** R2 **

int lo0

ip add 2.2.2.2 255.255.255.255

int fa0/0

ip add 192.168.1.2 255.255.255.252

no shut

int fa0/1

ip add 172.32.1.2 255.255.255.252

no shut

exit

ip route 0.0.0.0 0.0.0.0 192.168.1.1

ip route 0.0.0.0 0.0.0.0 fa0/1

** R1 **

int lo0

ip add 1.1.1.1 255.255.255.255

int fa0/0

ip add 192.168.1.1 255.255.255.252

no shut

int fa0/1

ip add 172.32.1.1 255.255.255.252

no shut

exit

ip route 0.0.0.0 0.0.0.0 192.168.1.2

ip route 0.0.0.0 0.0.0.0 fa0/1

How ever, now if you look at routing table for either R1 and R2, you will see that default route has got 2 paths.

I turned on the debugs and it also shows the same thing that 0.0.0.0 is added with metric [1/0] also where i have given exit interface.

R1#sh ip route 0.0.0.0

Routing entry for 0.0.0.0/0, supernet

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

  Routing Descriptor Blocks:

  * 192.168.1.2

      Route metric is 0, traffic share count is 1

    directly connected, via FastEthernet0/1

      Route metric is 0, traffic share count is 1

With fa0/0 shut

R1#sh ip route 0.0.0.0

Routing entry for 0.0.0.0/0, supernet

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

  Routing Descriptor Blocks:

  * directly connected, via FastEthernet0/1

      Route metric is 0, traffic share count is 1

R1#

With fa0/1 shut

R1#sh ip route 0.0.0.0

Routing entry for 0.0.0.0/0, supernet

  Known via "static", distance 1, metric 0, candidate default path

  Routing Descriptor Blocks:

  * 192.168.1.2

      Route metric is 0, traffic share count is 1

R1#

With both fa0/0 and fa0/1 UP

R1#debug ip routing

IP routing debugging is on

R1#

R1#clear ip route *

R1#

*Mar  1 00:15:18.395: RT: NET-RED 0.0.0.0/0

*Mar  1 00:15:18.395: RT: is_up: FastEthernet0/0 1 state: 4 sub state: 1 line: 1 has_route: True

*Mar  1 00:15:18.395: RT: add 192.168.1.0/30 via 0.0.0.0, connected metric [0/0]

*Mar  1 00:15:18.395: RT: NET-RED 192.168.1.0/30

*Mar  1 00:15:18.395: RT: interface FastEthernet0/0 added to routing table

*Mar  1 00:15:18.395: RT: is_up: FastEthernet0/1 1 state: 4 sub state: 1 line: 1 has_route: True

*Mar  1 00:15:18.395: RT: add 172.32.1.0/30 via 0.0.0.0, connected metric [0/0]

*Mar  1 00:15:18.395: RT: NET-RED 172.32.1.0/30

*Mar  1 00:15:18.399: RT: interface FastEthernet0/1 added to routing table

*Mar  1 00:15:18.399: RT: is_up: Loopback0 1 state: 4 sub state: 1 line: 0 has_route: True

*Mar  1 00:15:18.399: RT: add 1.1.1.1/32 via 0.0.0.0, connected metric [0/0]

*Mar  1 00:15:18.403: RT: NET-RED 1.1.1.1/32

*Mar  1 00:15:18.403: RT: interface Loopback0 added to routing table

*Mar  1 00:15:23.403: RT: add 0.0.0.0/0 via 0.0.0.0, static metric [1/0]

*Mar  1 00:15:23.403: RT: NET-RED 0.0.0.0/0

*Mar  1 00:15:23.407: RT: default path is now 0.0.0.0 via 0.0.0.0

*Mar  1 00:15:23.407: RT: new default network 0.0.0.0

*Mar  1 00:15:23.407: RT: NET-RED 0.0.0.0/0

*Mar  1 00:15:23.411: RT: add 0.0.0.0/0 via 192.168.1.2, static metric [1/0]

*Mar  1 00:15:23.411: RT: NET-RED 0.0.0.0/0

*Mar  1 00:15:23.411: RT: NET-RED 0.0.0.0/0

*Mar  1 00:15:23.415: RT: NET-RED 0.0.0.0/0

R1#

So, is it like what we have read and known about AD is wrong ??

Any guidance will be appreciated.

Regards,

Smitesh

25 Replies 25

Hi Jon,

First of all thanks for jumping into the discussion.

Secondly, I have never questioned Peter's knowledge.

Also, as you see the above discussion was very infomative. I requested Peter to pull any HoFs, just if they can bring up something which is overseen / not discussed.

PS: Never meant or intended to offend anyone about the knowledge. HoF inputs were request not to verify the discussion, but to share something which isn't discussed so far.

Regards,

Smitesh

Smitesh

No problem and i hope you didn't think i was suggesting you were questioning Peter's knowledge. I didn't think that and i don't think anyone was offended at all.

As i say , i do remember having this discussion before and we all came to the same conclusion ie. it is simply a change in IOS behaviour.

Jon

Hi All,

Was thinking about the whole discussion and have a new doubt.

What will the AD behaviour in case if it is Juniper or Extreme or Redback, etc.

Since, I don't have any other router as of now at my disposal, so throwing this question at community for the answer.

Thanks,

Smitesh

Smitesh

I am a bit late to this discussion. But since Peter asked me to participate then I offer these observations.

First: I affirm the principle that a static route is always a static route and always has AD of 1.

Second. I agree that there is cause for confusion because some outputs about the routing table do describe some static routes as being connected. There have been some books published (even some Cisco Press books) which talk about static routes on local interfaces and connected interfaces which state that they have AD that is different. But they are in error

I remember a discussion (I believe with Don Slice) with a Cisco engineer about how some routing protocols have different processing for routes out local interfaces. But that is how a routing protocol treats certain routes and does not equate to having a different Administrative Distance.

I have a fairly long memory of working with IOS. I do remember releases where show ip route would show a static route as directly connected. And this meant that the router would ARP for any address within that prefix. But what I remember is that if you did show ip route for that address range that it would come back with AD of 1.

HTH

Rick

HTH

Rick

Hi Rick,

Thanks for jumping in.

So, do that mean that even in older IOS, if egress interface is given, still AD will be 1 and not as what Vinayak & Peter have agreed earlier that in older IOS AD was assigned as 0 for egress interface.

Regards,

Smitesh

Smitesh

Yes I believe that IOS has been consistent that a static route has always been assigned AD of 1 (unless you use the optional parameter in a static route to specify an AD).

I believe that Vinayak did not correctly understand (or perhaps correctly remember) the behavior of IOS. And older versions of IOS did not present clearly what was going on. When you did a show ip route the results might show that there was a static for 0.0.0.0 and described it as connected via Fast0/0 and did not display the AD. It was easy to see the description as connected and assume that connected routes get AD of 0. But when you did a show ip route of the particular prefix then IOS would show the AD

R1#sh ip route 0.0.0.0

Routing entry for 0.0.0.0/0, supernet

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

HTH

Rick

HTH

Rick

Hi All,

Apologies for not closing this tread so far.

However, as far as AD is concern, my doubt is clear. But, this discussion is now turned more towards what the old IOS version behaviour was.

What I'm seeing here is divided opinion amongs the community members, on what old IOS used to do with the routes/prefix if egress interface is givin (whether AD = 0 was assigned or it was same as it is shown as of now).

Regards,

Smitesh

Hi All,

Understood that w.r.t a router static route would always be a static route with AD=1 ( also need to note, might be with new IOS releases)

But with older versions static route configured with via exit interface has been with AD=0 ( as discussed and seen above).

With this understanding about a static route, how can a network administrator has to take decision on confirming the traffic to the actual destination.

There will be no choice of decision, if one wants to do load balance the traffic, he has to go for new IOS releases or with old IOS versions he can't think of load balcing the traffic at all.

Request Peter and Jon, for their advice and suggestion.

Thanks/Nag

Hi,

As far as I know static routes always have an AD of 1 whether they point to a next-hop or to an interface and I thinks this has always benn like that for every IOS image whether old or new.

Regards.

Alain

Don't forget to rate helpful posts.

Rick/Jon/Peter,

We are talking about loadbalancing the traffic on those 2 static routes configured.

Request your suggestions.

Thanks/Nag

Hi,

as long as these are 2 equal longest match routes with same AD they will get installed in the RIB and the switching process will take care of load balancing, if this is CEF thenit will load balanced on a per flow basis.

Regards.

Alain

Don't forget to rate helpful posts.
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: