Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a route that I am manually adding at each reboot:

route add -net gw dev eth1

How can I make this route persistent?

I've seen quite a few articles online that suggest adding the following to /etc/networking/interfaces:

up route add -net gw dev eth1

but when I try this, the machine comes up without this route appearing in the routing table.

Thanks in advance.

share|improve this question
up vote 5 down vote accepted

putting it in /etc/networking/interfaces is often the best approach, you just have to put it in the right place... you didn't specify where you put it.

iface eth0 inet dhcp

I'm in the habit of using "ip" instead of "route". Another example:

iface eth1 inet static
  up ip route add via

Should work!

share|improve this answer
under debian the package iproute provides the ip binary – ThorstenS Aug 9 '09 at 21:45
route add -net gw dev eth1

You can also add that to your /etc/rc.local

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.