cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
240
Views
0
Helpful
1
Replies

Static routes - is this a bug?

darrenj
Level 1
Level 1

Hello all,

I have set-up two static routes as follows:

ip route 100.0.0.0 255.0.0.0 Ethernet1

ip route 100.0.0.0 255.0.0.0 20.2.1.2

The second static route (with a next hop IP of 20.2.1.2) uses a serial link. Am I right in saying that only the top route should appear in the routing table? I thought that a static route with an exit interface specified used an admin distance of 0, and a static route with a next hop IP specified used an admin distance of 1 - therefore, I thought only the top route would appear, but it doesn't!

To confirm this I ran a debug as follows:

Router#debug ip ?

routing Routing table events

Router#debug ip routing

IP routing debugging is on

Router#clear ip route *

00:33:34: RT: add 100.0.0.0/8 via 0.0.0.0, static metric [1/0]

00:33:34: RT: add 100.0.0.0/8 via 20.2.1.2, static metric [1/0]

Router#show ip route

S 100.0.0.0/8 is directly connected, Ethernet1

[1/0] via 20.2.1.2

As the debug output shows, both routes appear with a admin dis/metric of 1/0 when I thought one should be 0/0 and one should be 1/0. Also the 'show ip route' shows both routes in the routing table instead of one.

Anyone know whats going on?

Dazzler.

1 Reply 1

Gilles Dufour
Cisco Employee
Cisco Employee

this is the right behavior.

You should use floating static.

This is a static route with a higher admin distance.

ie:

ip route 100.0.0.0 255.0.0.0 Ethernet1

ip route 100.0.0.0 255.0.0.0 20.2.1.2 200

The first route will be in the routing table and the 2nd will be a backup.

If the first 1 disappear, the 2nd one will be inserted.

Review Cisco Networking for a $25 gift card