sed -i -e 's/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0 noquiet"/' /etc/default/grub
update-grub
GRUB更新后將接口名稱(chēng)更改為ethX,第一次啟動(dòng)后的原始名稱(chēng)將不起作用!!!!! 你必須編輯下面的接口,并重新啟動(dòng)!
Ubuntu18.04之前
vim /etc/network/interfaces
auto eth0
iface eth0 inet dhcp
Ubuntu18.04之后
sudo netplain generate
編輯配置文件
vim /etc/netplain/50-cloud-init.yaml
network:
ethernetes:
eth0:
dhcp4: true
version: 2
更新網(wǎng)卡信息
netplain apply