ifconfig settings are lost after reboot

how do i make them stay after rebooting?

samething with gw and dns.

assuming theres somekind of process on startup that enables dhcp.....

centos 5.5
Kylo RenSystem EngineerAsked:
Who is Participating?
ddiazpConnect With a Mentor Commented:
open the file:

/etc/sysconfig/network-scripts/ifcfg-ethX (depending on your ethernet device)

And post the contents. You want to make sure that it's enabled on startup and PROTO is DHCP.

DHCP should automatically populate the /etc/resolv.conf file with the nameserver and domain search. If not, edit your /etc/resolv.conf file like this:

search domain.com
nameserver <ip of DNS Server1> <ip of DNS Server2>

to verify the default gateway, type the command  "route"  and show the output; if there's none, you might need to put it in yourself:

route add -net default gw X.X.X.X (put ip of default gateway)

All these should be automatically updated with DHCP, but if it's not doing it, once you set it up manually as above, they should stay permanently.

You can test with ` service network restart`
Kylo RenSystem EngineerAuthor Commented:


I need to set it to static so i set it up as follows and saved.


it didnt work....

dhcp works but i need a static ip

thanks for the help!!

joolsConnect With a Mentor Commented:
if you have bootproto set to static then it should be static.

have you got any typos? Post the whole file back here.

if you want to create the config using the gui you can use system-config-network.

have you restarted the network service since that change?

can you type ifconfig -a and post the output?

When you say 'it didn't work', you mean the interface didn't get that IP address after network was restarted?
Kylo RenSystem EngineerAuthor Commented:
i accidently typed in a ip that was already in use which prevented the interface from coming up.  kept everything the same except for the ip and voila.  thanks guys
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.