Wednesday 16 April 2008

How to config dhcp client on Linux

By Editing configure file
Configure file /etc/sysconfig/network
Edit line : NETWORKING=yes
Configure file /etc/sysconfig/network-scripts/ifcfg-eth0 should contain the following lines:
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

By use Configuration Tools
Use command setup
# setup
Choose menu Network configuration
Choose your Device
Mark on menu Use DHCP
OK and exit Tools

Linux renew ip command
The -r flag explicitly releases the current lease, and once the lease has been released, the client exits. For example, open terminal and type the command:
$ sudo dhclient -r
Now obtain fresh IP:
$ sudo dhclient
There is no need to restart network service. Above command should work with any Linux such as RHEL, Fedora, CentOS, Ubuntu and others. On a related note you can also try out the following commands:
# ifdown eth0
# ifup eth0
# /etc/init.d/network restart

No comments: