http://www.cyberciti.biz/faq/howto-linux-renew-dhcp-client-ip-address/‘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?

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.

The dhclient command, provides a means for configuring one or more network interfaces using the Dynamic Host Configuration Protocol, BOOTP protocol, or if these protocols fail, by statically assigning an 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

How can I renew or release an IP in Linux for eth0?

To renew or release an IP address for the eth0 interface, enter:
$ sudo dhclient -r eth0
$ sudo dhclient eth0

In this example, I am renewing an IP address for my wireless interface:

sudo dhclient -v -r eth0
sudo dhclient -v eth0

Sample outputs:

Fig.01: Renew DHCP address example

The -v option shows information on screen about dhcp server and obtained lease.

Other options in Linux to renew dhcp

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
### RHEL/CentOS/Fedora specific command ###
# /etc/init.d/network restart

OR
### Debian / Ubuntu Linux specific command ###
# /etc/init.d/networking restart

nmcli command (NetworkManager) to renew IP address in Linux

The NetworkManager daemon attempts to make networking configuration and operation as painless and automatic as possible by managing the primary network connection and other network interfaces, like Ethernet, WiFi, and Mobile Broadband devices command-line tool for controlling NetworkManager. The nmcli is a command-line tool for controlling NetworkManager and getting its status. To renew IP address using nmcli for connection named ‘nixcraft_5G’ (use ‘nmcli con‘ command to get list of all connections):

nmcli con
nmcli con down id 'nixcraft_5G'
nmcli con up id 'nixcraft_5G'

Sample outputs:

Fig.02: nmcli command in action

See also

Linux Force DHCP Client (dhclient) to Renew IP Address的更多相关文章

  1. 15.Linux安装DHCP服务为虚拟机分配IP

    参考博客:http://www.jb51.net/article/31607.htm $ rpm -ql dhcp        #检查是否安装dhcp $ yum -y install dhcp*  ...

  2. 第一次使用Genymotion遇到的问题:for an unknown reson,VirtualBox DHCP has not assigned an IP address to virtual

    解决方案:http://www.aiuxian.com/article/p-554135.html

  3. Linux下DHCP服务安装配置

    简介 安装配置 一.简介 DHCP (Dynamic Host Configuration Protocol,动态主机管理协议)是一种基于UDP协议且仅限用于局域网的网络协议,主要用途是为局域网内部设 ...

  4. The Genymotion Virtual device could not obtain an IP address解决办法

    打开Genymotion运行虚拟机提示如下错误: The Genymotion Virtual device could not obtain an IP address.For an unknown ...

  5. Linux renew ip command

    $ sudo dhclient -r    //release ip 释放IP$ sudo dhclient       //获取IP Now obtain fresh IP:$ sudo dhcli ...

  6. linux之DHCP服务端搭建 ( ip分配 四个阶段原理)

    DHCP服务 ip分配 四个阶段原理 1.DHCP服务目的 协议 作用 租约 原理四个阶段 动态主机配置协议(Dynamic Host Configuration Protocol,动态主机配置协议) ...

  7. linux下DHCP服务原理总结

    DHCP(全称Dynamic host configuration protocol):动态主机配置协议DHCP工作在OSI的应用层,可以帮助计算机从指定的DHCP服务器获取配置信息的协议.(主要包括 ...

  8. Linux中DHCP服务器的简单配置

    我安装了两台linux系统,一个作为服务器,一个客户端 两个都有3个网卡, 后两个网卡聚合为zhi一个网卡:Linux 网卡聚合 两台电脑都一样. 那么如何为这个聚合网卡进行DHCP的分配呢? 1.由 ...

  9. 电脑无法上网,DHCP客户端不能正确获取IP地址

    问题特征:DHCP服务器更新[保留]配置信息后,给一客户端绑定了新的IP地址;但客户端IP地址并未正确更新; 处理: 一.检查DHCP服务器配置; 1.MAC地址.IP地址均正确;并已“添加到筛选器” ...

随机推荐

  1. 第14周 项目三-OOP版电子词典

    做一个简单的电子词典.在文件dictionary.txt中,保存的是英汉对比的一个词典,词汇量近8000个,英文.中文释义与词性间用'\t'隔开. (1)编程序,由用户输入英文词.显示词性和中文释义. ...

  2. Android 富文本框实现 RichEditText

    Android系统自带控件没有富文本框控件,如果想写一封带格式的邮件基本上不可能,EdtiText只有默认一种格式,显示不能滿足要求,!!正好项目需要研究了一下,开发了此控件,现将一些源代码开放一下, ...

  3. [置顶] Hibernate从入门到精通(七)多对一单向关联映射

    上次的博文Hibernate从入门到精通(六)一对一双向关联映射中我们介绍了一下一对一双向关联映射,本次博文我们讲解一下多对一关联映射 多对一单向关联映射 多对一关联映射与一对一关联映射类似,只是在多 ...

  4. win7 虚拟机 ios开发环境搭建

    http://www.cnblogs.com/xiaoyaoju/archive/2013/05/21/3091171.html

  5. C语言,数据类型

    #include <stdio.h> void f0(void) { printf("in linux:\n"); printf("sizeof(char) ...

  6. Vistual Studio 2012更换皮肤

    早就装上VS2012了,可是除了在家里练习玩玩的时候使用外,在公司都还在用2010,也没好好研究过2012.这两天把公司的电脑换了系统,也就把vs换成了2012.可是看着不是白白的皮肤就是深色的皮肤, ...

  7. The parent project must have a packaging type of POM

    在Eclipse中使用Maven添加模块时报错:The parent project must have a packaging type of POM 解决办法: 是将pom.xml 中的  < ...

  8. ajax动态加载的图标

    http://www.ajaxload.info/ 这个网站可以动态生成ajax加载样式的小图片,git格式,挺不错推荐给大家

  9. Python中使用Flask、MongoDB搭建简易图片服务器

    主要介绍了Python中使用Flask.MongoDB搭建简易图片服务器,本文是一个详细完整的教程,需要的朋友可以参考下 1.前期准备 通过 pip 或 easy_install 安装了 pymong ...

  10. 基于visual Studio2013解决C语言竞赛题之1033数字交换

          题目 解决代码及点评 /* 功能:将一个一维数组中的偶数依次交换.例如有8个元素, 若其中第1.4.5三元素是偶数时应按下图交换. 例子: a[]={2,3,1,6 ...