centos更改网卡名称格式
1、编辑网络配置
vi /etc/sysconfig/network-scripts/ifcfg-ens33
修改:
NAME=eth0
DEVICE=eth0
配置样例:
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
ONBOOT=yes
NAME=eth0
DEVICE=eth0
IPADDR=192.168.100.101
PREFIX=255.255.252.0
GATEWAY=192.168.100.1
DNS1=192.168.100.1PREFIX=255.255.252.0
GATEWAY=192.168.100.1
DNS1=192.168.100.1
2、修改网卡名称
mv /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts
/
ifcfg-eth0
3、修改grub文件
vi /etc/sysconfig/grub
修改GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=cen
tos
/swap rhgb quiet"
为GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap net.ifnames=0 biosdevname=0 rhgb quiet"
grub2-mkconfig -o /boot/grub2/grub.cfg
4、重启系统
reboot