static route

Unanswered Question
Feb 15th, 2009

Static Route:

ip route

If router cann't ping,but output interface fa0/0 is up, is this route item also in routing table?

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 3.4 (5 ratings)
bagvanliju Sun, 02/15/2009 - 01:49


Are you able to ping

(but output interface fa0/0 is up )

since this is an ethernet interface it will always shows up up is a P to P connectivity ..??/..

share the out put of sh ip route ...


scottmac Sun, 02/15/2009 - 06:22

Given the information provided, it could exist, but only because someone put it there ... but it'll never work (if the router is configured with conventional parameters).

Generally speaking, the "next hop" should be an interface that exists in the same segment as the host that needs to use it.

That said, you add nearly any static route into the routing table, it doesn't make the route valid; it's just saying "if you see a packet for this network, send it to this address" if the address is invalid, the packet gets dropped.

Good Luck


shivlu jain Sun, 02/15/2009 - 09:40

martin also check if is not reachable and the same router is having default router in that case the route is not going to flush from the routing table. Remeber one thing that static routes are recursive in nature. For that you need to add the route like given

ip route ser0/0

After adding that route if the serial interface will down the route will flush from routing table.


shivlu jain

Paolo Bevilacqua Sun, 02/15/2009 - 09:49

Shivlu, it seems that you are quite confused about how static routing works.

As ScottMac ha explained before, a correct static router aleways uses a directly connected next-hop address or interface.

Pointing a static route to another static route doesn'tmake any sense and should not be done.

Also, the ip route example that you gave, specifies both an interface and a next-hop address. That is never required.

Please make sure that you have full command of matters when you reply, as you can induce others in confusion and errors.

Richard Burts Sun, 02/15/2009 - 14:20


I believe that it is quite a stretch to say:"a correct static router aleways uses a directly connected next-hop address". You might say that it is best practice or you might say that it is preferred, but to say "always" goes too far.

Cisco's implementation of static routes is recursive, and it is quite valid to have a static routes whose next hop is not directly connected but is reached through some other entry in the routing table. We could create an example of when we might want to do this by thinking of 4 routers in a diamond patter with routers A, B, C, and D and with routers A and D at opposite ends of the diamond. So A can reach D through B or through C. Now assume that A wants to reach some destination that is outbound of router D, A needs to get to D to get to the destination. In your rule where a correct static always uses a directly connected next hop A could only have a static with B as the next hop or a static with C as the next hop. But it may be advantageous to have the static on A for the destination specify the address on D as the next hop, which gives the single static route the ability to use either of the neighbor routers.



Paolo Bevilacqua Sun, 02/15/2009 - 14:50

Rick, I don't agree with that approach.

Even if cisco routing is forgiving of the bad practice of using a non directly connected next-hop, its use generates confusing configurations that are in direct contrast to the basic hop-by-hop paradigm of IP routing.

I understand that in iBGP recursive routing must be used, however in that case it is done by design and in a controlled manner.

In your example, if all static routing is to be used, A must be able to reach D via explicitly configured B and C routes. The same should be done for any destination behind D, without seeking configuration shortcuts. If you want less configuration work, use a routing protocol instead of a topology-hiding kludge.

At least, that is the way I and my peers have been taught to do in 20 years of IP networking.

marikakis Sun, 02/15/2009 - 14:58


I confirm that static routes can be configured with a non-directly connected next-hop. The best practice is to avoid them because they converge more slowly and can create unexpected routing loops. Also, static routes that reference interfaces only are recommended when the corresponding interface is point-to-point. In all other cases, the recommendation is to use both output interface and next-hop. That is so because, in most other cases, if only the next-hop is specified, the outgoing interface is determined by recursive routing lookup. If only the interface is specified, another step is needed to find the next-hop. All these are described in detail in the book Cisco IP Routing by Alex Zinin, which is (surprisingly) not from cisco press and I would call it the bible of IGP routing.

Kind Regards,


Paolo Bevilacqua Sun, 02/15/2009 - 15:10

the recommendation is to use both output interface and next-hop

Why? A next-hop on a multi-access interface already identifies uniquely the interface to be used. Unless you want to use that to prevent recursive routing precisely, however in sane networks I never saw that need.

marikakis Sun, 02/15/2009 - 16:23

The interface to be used is seemingly identified automatically via the next-hop, but, as is the case with many computer functions perceived as automatic by humans, some machine has to do some more work to maintain the automatic illusion and some programmer wrote some code that actually instructs the machine to do the required task. The router has to determine the interface out of which the particular next hop is reachable, which means more work for the machine. Still, the most common pitfall to avoid in practical situations is to not specify only an outgoing interface in multi-access segments.

p.s. In my first semester in technical school (that would be 13 years ago) we were asked to write a program that added fractions. I had never used a computer before (there were no computers in the village I come from) and I was left with mouth open: Do you really mean that a computer cannot add fractions? :-)))

Paolo Bevilacqua Mon, 02/16/2009 - 02:38

Maria, the way you present your arguments is so convincing that from now on I'll have interface and next-hop tattooed on the router case.

When I began technical school, our only preoccupation was to destroy anything. I've improved a lot since then, however.

JamesLuther Mon, 02/16/2009 - 03:09


Specifing an interface as well as a next hop is useful when you're injecting a static route into BGP (ie on the edge of two routing domains).

If the interface goes down the route will stop being advertised into BGP and BGP will find an alternative route (second entry point).

If you don't specify an interface parameter the route will still be advertised into BGP if there is a recursive lookup available (ie via a default route). This is probably not desirable!!

Paolo Bevilacqua Mon, 02/16/2009 - 03:26

Hi James,

I agree with what you said except that recursive routes are never installed in table by virtue of default.

You need a specific route to the distant next-hop for a recursive route to be effective.

JamesLuther Mon, 02/16/2009 - 03:43


Lets take the original example, if you have the following configured

ip route

and you have an interface with IP Now the interface goes down. Normally this route will disappear from the routing table unless the router thinks it can still get to it via a default route or a summarised route (ie 20.20.0./16). If there is another less specific route in the table to the next hop then it will still place the static route into the table because it can do a recursive lookup.

I hope that makes sense?

If you are then advertising that static into a routing protocol then you can end up with a routing loop. That's where specifying the interface and next hop IP is useful.

Paolo Bevilacqua Mon, 02/16/2009 - 03:50


I understand you explanation. My objection is that a default route is not usable to install a recursive route. You can try that yourself.

Since you specifically have mentioned default in your examples, I wanted to clarify that this is not the case.


This Discussion