11.网络管理4-rhel7修改网卡名

备份eno16777736网卡配置,并复制出一个ifcfg-eth0

[root@rhel7 network-scripts]# cp ifcfg-eno16777736 ifcfg-eno16777736.bak
[root@rhel7 network-scripts]# cp ifcfg-eno16777736 ifcfg-eth0

修改ifcfg-eth0中的NAME和DEVICE为eth0

[root@rhel7 network-scripts]# vim ifcfg-eth0

禁用可预测命名空间属性

[root@rhel7 network-scripts]# vim /etc/default/grub

找到GRUB_CMDLINE_LINUX行,直接到最后添加,net.ifnames=0 biosdevname=0

更新grub配置文件

[root@rhel7 network-scripts]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-327.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-f564014198524384922d10f71c47162b
Found initrd image: /boot/initramfs-0-rescue-f564014198524384922d10f71c47162b.img
done

重启

[root@rhel7 network-scripts]# reboot

验证

[zbf@rhel7 ~]$ ifconfig
posted @ 2022-04-28 22:46  姬雨晨  阅读(82)  评论(0编辑  收藏  举报