ubuntu16.04修改网卡名称为eth0

2017-11-24

ubuntu16.04 修改网卡名称为 eth0

  1. sudo nano /etc/default/grub

找到 GRUB_CMDLINE_LINUX=""
改为 GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
然后 sudo grub-mkconfig -o /boot/grub/grub.cfg

  1. 打开 Ubuntu 的/etc/network/interfaces 文件默认的内容如下:

   auto lo
   iface lo inet loopback

  • 获取动态配置:

   auto eth0
   iface eth0 inet dhcp

  • 获取静态配置:

   auto eth0
   iface eth0 inet static
   address 192.168.0.1
   netmask 255.255.255.0
   gateway 192.168.0.1

  重启


标题:ubuntu16.04修改网卡名称为eth0
作者:散宜生
地址:https://17kblog.com/articles/2017/11/24/1511495532856.html