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 run this command to get the the internet working on a server of mine. represents the gateway for the VLAN. What do I have to do to make this change survive a reboot?

/sbin/route add -net gw eth0
share|improve this question
What distro are you running? – Ladadadada Apr 12 '12 at 9:09
up vote 2 down vote accepted

That depends on your distribution.

If it's a Debian-derivative or Red Hat-derivative, edit /etc/network/interfaces and add a gateway entry to the active network interface.

On next reboot, it will be set.

share|improve this answer
If it's a Red Hat derivative, edit /etc/sysconfig/network-scripts/ifcfg-$INTERFACE and set GATEWAY= – 200_success Apr 12 '12 at 10:12
@200_success, heh-- sorry for not posting the distro, you nailed it – GoldenNewby Apr 12 '12 at 19:22

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.