修改后:
[TomAndersen@localhost ~]$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 00:0c:29:35:00:eb txqueuelen 1000 (Ethernet)
RX packets 1 bytes 243 (243.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
修改步骤:
1. 修改ifcfg-ens文件
[TomAndersen@localhost network-scripts]$ vim /etc/sysconfig/network-scripts/ifcfg-ens33
- 将 NAME 和 DEVICE 变量修改为需要改成的网卡名,变量值必须相同,然后强制保存退出
- 修改ifcfg-ens文件名,将其后缀修改成对应网卡名
[TomAndersen@localhost network-scripts]$ mv ifcfg-ens33 ifcfg-eth0
2. 修改grub文件
[TomAndersen@localhost network-scripts]$ vim /etc/sysconfig/grub
- 在 GRUB_CMDLINE_LINUX 变量中插入 net.ifnames=0 biosdevname=0,然后保存退出
- 重新加载内核参数
[TomAndersen@localhost network-scripts]$ grub2-mkconfig -o /boott/grub2/grub.cfg
[TomAndersen@localhost network-scripts]$ sudo reboot