Configure Linux DHCP client ( dhclient ) to persistently look for an IP address lease

by Vivek Gite on December 24, 2007 · 1 comment

Q. I've HP Laptop installed with CentOS 5 workstation operating system. How can I configure Linux dhclient command to continuously requests an IP lease until one is granted by DHCP Server / Router?

A. You need to set the PERSISTENT_DHCLIENT option by editing Ethernet configuration file. This option is turned off by default.

Login as the root user

Open /etc/sysconfig/network-scripts/ifcfg-eth0 file to set eth0 to persistently look for an IP address lease:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Append line PERSISTENT_DHCLIENT=1, at the end configuration should look as follows:
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
PERSISTENT_DHCLIENT=1

Save and close the file. Restart networking service or reboot laptop / desktop to test the changes:
# /etc/init.d/networking restart

Please note that your network switches and other protocol may need to configure properly to work with this option.

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 1 comment… read it below or add one }

1 skynet May 13, 2009

“Save and close the file. Restart networking service or reboot laptop / desktop to test the changes:
# /etc/init.d/networking restart”

should be:
# /etc/init.d/network restart

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 6 + 11 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: