Skip to main content

Administrative Distance of the Connected route

More
17 years 2 months ago #23289 by tsunami
Hi All,

I need a clarification. I have configured two static routes on the router.

one is pointing to the next hop and one at the exit interface.


================================================================
ip route 192.168.1.0 255.255.255.0 serial1/0
ip route 192.168.1.0 255.255.255.0 10.1.1.2
================================================================

Theoritically, the Administrative distance of the connected route is 0.
However, when I run a show ip route on the router, I see both static routes,
one with the next hop and one with the exit interface getting load balanced.

Here is the output.

=================================================================

172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, Loopback1
10.0.0.0/30 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, Serial1/0
S 192.168.1.0/24 [1/0] via 10.1.1.2
is directly connected, Serial1/0
=================================================================

So, the Question is wether the AD of the static connected route is 1 or 0 ?

Thanks in Advance.

Tsunami
More
17 years 2 months ago #23290 by S0lo
I'm confused a bit,

Your defining 2 static routes for the same network to point to the same location (one on interface and one next hop). And in the middle of the talk you note that it is also directly connected.

If it is directly connected. you could have just defined one additional static route to see which AD rules, why 2 routes ? :?

Studying CCNP...

Ammar Muqaddas
Forum Moderator
www.firewall.cx
More
17 years 2 months ago #23291 by tsunami
yeah. I know it does not make any practical sense.

The following is according to Routing TCP/IP Volume 1:

For example, static routes pointing to a next-hop address have an administrative distance of 1, and static
routes referencing an exit interface have an administrative distance of 0. If two static routes point to the
same destination, but one references a next-hop address and one references an exit interface, the latter—
with the lower administrative distance—will be preferred


I just wanted to verify this statement which is not true any more!
More
17 years 1 month ago #23330 by Elohim
I believe if you set the route to the interface that will be 0 (no hop) because it is the connected interface that is the gateway, and if you set it to the far end ip address, than it will be a 1 because it is 1 hop away... however, keep in mind that if you set the next hop to the connected interface, your router will suffer performance as it will arp for everything instead of just the IPs it is connected to.

yeah. I know it does not make any practical sense.

The following is according to Routing TCP/IP Volume 1:

For example, static routes pointing to a next-hop address have an administrative distance of 1, and static
routes referencing an exit interface have an administrative distance of 0. If two static routes point to the
same destination, but one references a next-hop address and one references an exit interface, the latter—
with the lower administrative distance—will be preferred


I just wanted to verify this statement which is not true any more!

More
17 years 1 month ago #23372 by S0lo
Understood your trial, I suggest the following to test your case. First let the subnet of the route be a remote one not a directly connected one. Say 192.168.3.0/24. then add this:

[code:1]
ip route 192.168.3.0 255.255.255.0 serial1/0
ip route 192.168.3.0 255.255.255.0 10.1.1.10
[/code:1]

Let serial1/0 be on a different link than the 10.1.1.10 mentioned above. So you have 2 routes pointing a to same location but directing the packets to go to different locations. Then issue this:

[code:1]
debug ip packet
[/code:1]


Ping something in 192.168.3.0/24. If the packets go to serial1/0 side (debugging shows it). then the first route with AD=0 rules. If the packets go to the 10.1.1.10 side then the second route rules.

Hope that helps.

Studying CCNP...

Ammar Muqaddas
Forum Moderator
www.firewall.cx
Time to create page: 0.127 seconds