Centos7更改网卡名称eth0

时间:2026-02-11 22:05:15

1、用ifconfig查看网卡名称为ens33,现在要将它修改成eth0

Centos7更改网卡名称eth0

2、编辑配置文件/etc/sysconfig/network-scripts/ifcfg-eno16777736

将DEVICE=eno16777736修改成DEVICE=eth0

保存并退出

Centos7更改网卡名称eth0

3、重命名该配置文件。

[root@remote network-scripts]# cd /etc/sysconfig/network-scripts/

[root@remote network-scripts]# mv ifcfg-eno16777736 ifcfg-eth0

Centos7更改网卡名称eth0

4、编辑/etc/default/grub并加入“net.ifnames=0 biosdevname=0 ”

同样是保存并退出

Centos7更改网卡名称eth0

5、运行命令grub2-mkconfig -o /boot/grub2/grub.cfg 来重新生成GRUB配置并更新内核参数

Centos7更改网卡名称eth0

6、使用reboot命令重启操作系统

Centos7更改网卡名称eth0

7、重启完成之后进入系统使用ifconfig命令查看网卡名称已经修改成eth0了

Centos7更改网卡名称eth0

© 2026 长短途
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com