Static route with 'permanent'

Answered Question

Studying for BSCI and I ran across the option of adding 'permanent' to a static route. It says that with this option, a static route will stay in the routing table even if the interface it's related to goes down.

However, what I can't figure out is what good is that? Why would I want an invalid route to stay there? Anyone have any ideas?

I have this problem too.
0 votes
Correct Answer by sundar.palaniappan about 9 years 7 months ago

There can be many reasons why using the permanent keyword in a static route can be beneficial. I can think of one scenario where this would be helpful.

Here's a router config. Let's say the only way to get to network 10.1.1.0 is via e0. If you didn't have the permanent keyword in the static route for 10.1.1.0 then when e0 is down the router would forward the traffic using the default route via e1 and the traffic would have eventually failed but in the process would have used up some router resources unnecessarily. Instead, using the permanent keyword would cause the packets to 10.1.1.0 get dropped when e0 is down.

Router_A:

int e0

ip add 172.16.1.1 255.255.255.0

int e1

ip add 192.168.1.1 255.255.255.0

ip route 10.1.1.0 255.255.255.0 172.16.1.2 permanent

ip route 0.0.0.0 0.0.0.0 192.168.1.2

HTH

Sundar

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.7 (4 ratings)
Loading.
Correct Answer
sundar.palaniappan Fri, 02/02/2007 - 14:33

There can be many reasons why using the permanent keyword in a static route can be beneficial. I can think of one scenario where this would be helpful.

Here's a router config. Let's say the only way to get to network 10.1.1.0 is via e0. If you didn't have the permanent keyword in the static route for 10.1.1.0 then when e0 is down the router would forward the traffic using the default route via e1 and the traffic would have eventually failed but in the process would have used up some router resources unnecessarily. Instead, using the permanent keyword would cause the packets to 10.1.1.0 get dropped when e0 is down.

Router_A:

int e0

ip add 172.16.1.1 255.255.255.0

int e1

ip add 192.168.1.1 255.255.255.0

ip route 10.1.1.0 255.255.255.0 172.16.1.2 permanent

ip route 0.0.0.0 0.0.0.0 192.168.1.2

HTH

Sundar

Richard Burts Fri, 02/02/2007 - 14:33

David

Sure. Sometimes it is "better" to have a more stable network than it is to have exact precision in your routing table. One scenario: you have some destinations for which you have static routes which you redistribute into your dynamic protocol. And you have some remote locations where you do not want to consume bandwidth with routing updates that you could avoid or you have some routers where you do not want routing updates and convergence to chew up CPU cycles if you can avoid it. So you configure your static routes as permanent. They always stay in the routing table, no bandwidth used for routing updates, no CPU cycles for convergence. The downside is that some traffic gets sent to you that you can not forward and must discard.

Second scenario: probably even more common. You are running BGP with multiple service providers. You have some static routes in your routing table so that the BGP network statements will have a match. To prevent flapping of your advertisements to the providers you want the static route to always be present in the routing table. (Of course many of us accomplish this with static routes to null 0 - but the static permanent is another alternatie).

And Sundar makes another good point about possible advantage of the permanent static.

HTH

Rick

Actions

This Discussion