ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

How can I renew or release an IP in Linux?

Ip changing in linux

user-image
تم إضافة السؤال من قبل Sreenath MT , Senior IT Engineer , Ramniklal B Kothary
تاريخ النشر: 2013/07/09
Abdulrahim Mohamad Shoueib Alyafi
من قبل 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
من قبل 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
من قبل 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
من قبل 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
من قبل 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
من قبل 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.

 

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟