Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I would like to change my ip address and subnet mask with the following command: ifconfig eth1 netmask up


route add default gw

when I reboot my linux it's gone. I would like to keep it permanent with this command. is it possible?


share|improve this question

3 Answers 3

up vote 1 down vote accepted

If you don't want the sys V way, you can add

/sbin/route add default gw

to /etc/rc.d/rc.local . Although, editing the initi scripts as qweet points out is better.

share|improve this answer

The ifcfg script contains permanent details of your internet devices. You can find them in /etc/sysconfig/network-scripts/ifcfg-<devicetype><num>. There, you should alter/add the following to ifcfg-eth1:


Which should do the trick. To see the changes in effect, do a sudo /etc/init.d/network restart

share|improve this answer

maybe this link will help. static IP tutorial

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.