Q. I'm using Ubuntu Linux. How to force Linux to reacquire a new IP address from the DHCP server? What is the command in Linux equivalent to Windows' "ipconfig /renew" Command?
A. You need to use Dynamic Host Configuration Protocol Client i.e. dhclient command. The client normally doesn't release the current lease as it is not required by the DHCP protocol. Some cable ISPs require their clients to notify the server if they wish to release an assigned IP address.
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 distro 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
OR
# /etc/init.d/networking restart
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- My 10 UNIX Command Line Mistakes
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
- Email FAQ to a friend
- Download PDF version
- Printable version
- Comment RSS feed
- Last Updated: 12/23/07



{ 10 comments… read them below or add one }
Resolution provided was short but very effective.
Helped me to resolve the issue.
Great work
Thanks
Rajesh
Hi,
This worked great, I was having a bit of problems thought worked them out in the end, thought I would share.
I unplugged the network cable, then plugged back in a couple minutes later. Couldn’t access network, tried dhclient -r command and didn’t work. Found that dhcpcd was still running, so done a killall -9 dhcpcd then executed dhclient…worked!
Thanks so much! it’s work ^^
Thanks!
This command worked me..thanks a lot
This does not work on Ubuntu 9.04
It seems that network manager runs it own copy of dhclient.
Works for me on Ubuntu 9.04. It seems to me, that the network-manager does not notice the change. After sudo dhclient -r the command ifconfig eth0 shows no ip address at the interface. After sudo dhclient the command ifconfig eth0 shows an ip address again.
Thank you
Nope. After sudo dhclient -r the interface still has the IP address. See details: http://pastebin.com/f8d2a4e2
Dear sir
Please Help Me
How t o Assign IP Address For DHCP Client Linux..
Thanks
Thank you for the recommendation, it works good.