Ubuntu 18.04 dhcp更换新IP

栏目: 服务器 · 发布时间: 4年前

内容简介:今天在准备弄一个虚拟机集群,自然是装好一个,然后clone成三份。但是有一个问题,clone的时候虽然选择了更换所以就需要把即可。

今天在准备弄一个虚拟机集群,自然是装好一个,然后clone成三份。但是有一个问题,clone的时候虽然选择了更换 MAC 地址,但是 起来之后发现ip地址还是没变。原来是 systemd-networkd 的老bug。它不是根据 MAC 地址来决定是否换IP,而是根据 /etc/machine-id 来计算出来一个值,如果这个值发生了变化,那么就更换IP地址。

所以就需要把 /etc/machine-id 给换一下。

$ sudo su
# uuidgen | sed 's/-//g' > /etc/machine-id
# reboot

即可。

参考资料:


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Introduction to Computation and Programming Using Python

Introduction to Computation and Programming Using Python

John V. Guttag / The MIT Press / 2013-7 / USD 25.00

This book introduces students with little or no prior programming experience to the art of computational problem solving using Python and various Python libraries, including PyLab. It provides student......一起来看看 《Introduction to Computation and Programming Using Python》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具