本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名原文链接~~~

Ubuntu 18.04 修改网卡名为 ethx

微信搜索 zze_coding 或扫描 👉 二维码关注我的微信公众号获取更多资源推送:


查看当前网卡名是 ens33

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:0c:29:e5:00:e4 brd ff:ff:ff:ff:ff:ff
    inet 172.20.0.20/24 brd 172.20.0.255 scope global ens33
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fee5:e4/64 scope link 
       valid_lft forever preferred_lft forever

修改 grub 配置:

$ vim /etc/default/grub
# 仅修改此参数
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

更新 grub 配置:

$ update-grub
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-156-generic
Found initrd image: /boot/initrd.img-4.15.0-156-generic
done

重启系统:

$ reboot
# Linux 杂项  

如果这篇文章对您有帮助,可点击下方链接分享给你的朋友们😋,如果遇到问题欢迎评论、留言~~~😇

评论

公众号:zze_coding

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×