ubuntu16.04修改网卡名称enp2s0为eth0

ubuntu16.04修改网卡名称enp2s0为eth0

 

最后删除70  -persient

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
重启后,网卡名称果然变成了eth0和wlan0
  • 1
  • 2
  • 3
  • 4

2、打开ubuntu的/etc/network/interfaces文件默认的内容如下:

auto lo
iface lo inet loopback
  • 1
  • 2

在后面添加内容 
1、获取动态配置:

auto eth0
iface eth0 inet dhcp
  • 1
  • 2

 

重启网卡使设定生效:sudo /etc/init.d/networking restart

 

2、获取静态配置:

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



posted on 2018-08-01 18:34  Areon  阅读(1432)  评论(0)    收藏  举报

导航