将网卡名ens160修改为eth0:
查看连接信息:
[19:36:04 root@centos8 ~]# nmcli connection show
NAME UUID TYPE DEVICE
ens160 8e4af756-c080-4279-ad1f-ab5347f89de1 ethernet ens160
virbr0 5ad88c30-92fb-46e6-851c-5381a34afd79 bridge virbr0
新增连接eth0:
[19:39:00 root@centos8 ~]# nmcli connection add type ethernet con-name eth0 ifname ens160
Connection ‘eth0’ (5b1a8aa6-944d-4ee0-8801-3a0bbb890bd1) successfully added.
[19:42:59 root@centos8 ~]# nmcli connection show
NAME UUID TYPE DEVICE
ens160 8e4af756-c080-4279-ad1f-ab5347f89de1 ethernet ens160
virbr0 5ad88c30-92fb-46e6-851c-5381a34afd79 bridge virbr0
eth0 5b1a8aa6-944d-4ee0-8801-3a0bbb890bd1 ethernet –
删除网卡ens160:
修改网卡名称:
修改Linux核心配置:
备份配置文件:
修改配置文件为:
生成启动文件:
#grub2-mkconfig -o /boot/grub2/grub.cfg
重启: