cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1574
Views
0
Helpful
7
Replies

How to inject a static route only when the interface is up

jristo
Level 1
Level 1

We wish to be able to inject a static route into the tables only when a specific interface is up. Otherwise we don't want to publish this information across the entire network.

Our route maps havn't been working with the verify available, so does someone have a working example they can share?

thanks

7 Replies 7

t.baranski
Level 4
Level 4

Hopefully I understand your question correctly: Is the interface in question the interface that the static route points to? If so, when that interface goes down the static route should be removed from the routing table (assuming the "permanent" keyword isn't being used), and hence no longer be redistributed.

regretabilly, we do not have that situation. We have, as example, the following:

ip route 10.20.30.0 255.255.255.248 172.168.10.3

The reason we didn't go with a route out the interface port, is that the device at 172.168.10.3 is not allowed to do proxy arp (variety of reasons I won't go into here) and we didn't believe that when the packet was dumped out the interface that it would end up going anywhere without this feature.

Does anyone know if there is a way to control dynamically the injection of the above route to track on FE 0/0 status (if up, route in... if down, don't put it in)

Thanks

If 172.168.10.3 is directly connected, the route should disappear from the routing table when the interface goes down, as the next hop is no longer reachable (unless there is a backup route to 172.168.10.3).

What is the output of

show ip route 172.168.10.3

show ip route 10.20.30.0

when the interface is down?

Herbert

172.168.10.2 is the local address, 172.168.10.3 is the far end of that segment.

When the interface is down (we pulled the plug) the local connected route dissappears (as it should) but the static we have defined (as detailed previously) remains.

I didn't believe that a static that points to an IP dissappears at all from the routing table. I thought it was only when it points to an interface does it leave when that interface goes down.

I tried it on a test router, and my static route that points to an ip address next hop, dissappears from the routing table when I shutdown the interface the nexthop is connected to.

In general, a static route with an ip nexthop will not be in the routing table if the nexthop is not in the routing table (unless the static route is defined as permanent).

So, what is the output of

show ip route 172.168.10.3

show ip route 10.20.30.0

when the interface is down?

Herbert

Herbert,

a) maybe there is a difference between shutdown the interface and pulling the cable out?

b} I've got a more difficult question:

Is it possible to recognize that the next-hop router itself is not available anymore (switched off while the local E0 is up, e.g.) and remove the static route defined by the next-hop address from the routing table?

Regards,

Milan

Hi,

If you still observing the same route, then definitely you are having static or dynamically learned route/s to reach 172.168.10.3. Give "sh ip ro 172.168.10.3" as asked in prev post for both when i/f up and i/f down.

Ashok.


With best regards...
Ashok
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: