Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I run this command to get the the internet working on a server of mine. 174.0.0.1 represents the gateway for the VLAN. What do I have to do to make this change survive a reboot?

/sbin/route add -net 0.0.0.0 gw 174.0.0.1 eth0
share|improve this question
    
What distro are you running? –  Ladadadada Apr 12 '12 at 9:09
add comment

1 Answer

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
2  
If it's a Red Hat derivative, edit /etc/sysconfig/network-scripts/ifcfg-$INTERFACE and set GATEWAY=174.0.0.1. –  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
add comment

Your Answer

 
discard

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.