Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How can I renew or release an IP in Linux?

Ip changing in linux

user-image
Question added by Sreenath MT , Senior IT Engineer , Ramniklal B Kothary
Date Posted: 2013/07/09
Abdulrahim Mohamad Shoueib Alyafi
by Abdulrahim Mohamad Shoueib Alyafi , Information Technology Manager , Faii Alriyadh Establishment for Contracting

You have4th configuration for client and network: # vim /etc/hosts # vim /etc/resolv.conf # vim /etc/sysconfig/network-scripts/ifcfg- # vim /etc/sysconfig/network

You have4th configuration for client and network: # vim /etc/hosts # vim /etc/resolv.conf # vim /etc/sysconfig/network-scripts/ifcfg- # vim /etc/sysconfig/network

Ishagh Bah
by Ishagh Bah , Developer and system expert , Orbit

If you are dhcp client you can restart your interface by ifconfig eth0 down ifconfig eth0 up or run dhclient eth0 where eth0 is the name of the interface

Sajan Kumar
by Sajan Kumar , Technical Leader (Tech Lead) , EduAlert Services Pvt Ltd

Hi Sreenath, You can use Linux renew ip command.
Don't edit hosts.conf and all.
Its not required.
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 Hope this could help you out! Regards, Sajan.S

NAFI RAHMAN KATTIL PUTHIYA PURA
by NAFI RAHMAN KATTIL PUTHIYA PURA , IT Support Engineer , Cleveland Clinic Abu Dhabi

Hi,You can execute following commands to release and renew ip in linux:

sudo dhclient -v -r eth0 --> to release ip

sudo dhclient -v eth0 --> to renew ip or  ifconfig eth0 downifconfig eth0 up

Rostom El Baz
by Rostom El Baz , ICT-Project Engineer , Alghanim International

 ifconfig eth0 downRunning the above command would take the eth0 interface (the first network card) down. Which is the same as releasing the IP address from that network card.

ifconfig eth0 up 

typing in the above command would bring that interface back up.

or dhclient eth0

Renews the IP address assigned to it by DHCP.

Akash Dubey
by Akash Dubey , Senior Technical Lead , Fulcrum Software Worldwide Pvt. Ltd.

use ifdown eth0 to bring it down and ifup eth0 to bring it back up.

 

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.