1 修改网卡名称
cd /etc/sysconfig/network-scripts/ mv ifcfg-ens33 ifcfg-eth0
2 修改网卡配置文件
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 TYPE="Ethernet" BOOTPROTO="none" DEFROUTE="yes" IPV4_FAILURE_FATAL="yes" IPV6INIT="yes" IPV6_AUTOCONF="yes" IPV6_DEFROUTE="yes" IPV6_FAILURE_FATAL="no" IPV6_ADDR_GEN_MODE="stable-privacy" NAME="eth0" UUID="92a1e90a-7cf2-46aa-bdcb-81bc5b96fbc3" DEVICE="eth0" ONBOOT="yes" IPADDR="10.10.172.235" PREFIX="24" GATEWAY="10.10.172.1" DNS1="192.168.172.208" DNS2="192.168.172.209" IPV6_PEERDNS="yes" IPV6_PEERROUTES="yes" IPV6_PRIVACY="no"
3 修改grub
加入以下内容 net.ifnames=0 biosdevname=0 配置文件内容如下所示: [root@localhost ~]# cat /etc/sysconfig/grub GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet net.ifnames=0 biosdevname=0" GRUB_DISABLE_RECOVERY="true"
4 生成启动菜单
grub2-mkconfig -o /boot/grub2/grub.cfg
5 重启系统
reboot