refresh IP from dhcp isp

Alan Horn ahorn at deorth.org
Fri Dec 24 01:11:28 UTC 2004


On Thu, 23 Dec 2004, kate wrote:

>> Actually.. its fairly rare on Linux :)
>>
>> Cheers,
>>
>> Al
> And a Merry Christmas to you, Al ... :}
> kate

Ok.. here we go.

To renew a DHCP lease :

I would *guess* something like :

/sbin/ifdown <ifname>
pkill dhclient
dhclient -r <ifname>
/sbin/ifup <ifname>

First line takes the interface down
Second line kills any dhclient processes that may happen to be around
Third line releases the address and exits
Fourth line brings the interace up again, which if its configured to 
use dhcp, will fire up a new dhclient and get a whole new lease.

This is untested from the top of my head and reading the manpage.. YMMV. 
Specifically, multiple dhclient processes would be badly affected by this, 
also if you don't configure your interface to use dhcp on boot the 
ifup/ifdown stuff isn't going to work right.

If you want more help, please email me directly, ahorn at deorth.org.

Cheers,

Al





More information about the fedora-list mailing list