Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

How can I renew or release an IP in Linux?

Ip changing in linux

user-image
Question ajoutée par Sreenath MT , Senior IT Engineer , Ramniklal B Kothary
Date de publication: 2013/07/09
Abdulrahim Mohamad Shoueib Alyafi
par 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
par 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
par 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
par 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
par 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
par 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

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?