Changing from Static IP to DHCP without rebooting

A place to ask all newbie questions and not get flamed, though you will get beaten down if you post a newbieish question outside of these walls.
Post Reply
Krazy
Adept
Posts: 54
Joined: Wed Sep 10, 2003 8:41 pm
Location: Auckland, New Zealand

Changing from Static IP to DHCP without rebooting

Post by Krazy »

Hi,

This is not a problem, but rather a mini-hint for other newbies like myself.

If you've accidentally started Gentoox without a network connection, then it defaults to 192.168.1.13. Assuming you can login via the console (USB keyboard), then you might want to change your IP address to one issued by your (external) DHCP server instead. This may be useful if the rest of your network doesn't live in 192.168.1.x range.

I've figured out to do this without rebooting.

First pause your networking on eth0 [normal ethernet connection]:

Code: Select all

/etc/init.d/net.eth0 pause
This avoids stopping all services that rely on networking being available.

ifconfig will then show only lo [loopback]

Then start networking again with:

Code: Select all

/etc/init.d/net.eth0 start
ifconfig should then confirm eth0 is available with a IP address allocated by your DHCP server.


The only issue that I know of is that the temporary file created while booting [/tmp/eth0.addr] is not updated; it retains the same network information as displayed at the end of the normal boot process

Any comments, or other issues that I might have overlooked?
Post Reply