- 编辑文件引导文件
# vi /etc/default/grub 初始值 GRUB_CMDLINE_LINUX="crashkernel=auto resume=/dev/mapper/rl-swap rd.lvm.lv=rl/root rd.lvm.lv=rl/swap" 修改为 GRUB_CMDLINE_LINUX="crashkernel=auto resume=/dev/mapper/rl-swap rd.lvm.lv=rl/root rd.lvm.lv=rl/swap net.ifnames=0 biosdevname=0" 添加 net.ifnames=0 biosdevname=0
- 重新生成一个开机文件引导文件
# grub2-mkconfig -o /boot/grub2/grub.cfg
- 修改网卡配置和地址
# mv /etc/sysconfig/network-scripts/ifcfg-{ens33,eth0} # cat > /etc/sysconfig/network-scripts/ifcfg-eth0 <<EOF TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=static DEFROUTE=yes NAME=eth0 DEVICE=eth0 ONBOOT=yes IPADDR=192.168.31.168 NETMASK=255.255.255.0 GATEWAY=192.168.31.254 DNS1=114.114.114.114 DNS1=8.8.8.8 EOF
4.重启
# reboot