进入到这个目录cd /etc/sysconfig/network-scripts/
查找ifcfg-*文件ll ifcfg-*
vi ifcfg-eth0DEVICE=eth0HWADDR=00:0C:29:3C:9B:42TYPE=EthernetUUID=8bddfc5c-2432-404b-b186-7c2361417e97ONBOOT=yesNM_CONTROLLED=yesBOOTPROTO=staticIPADDR=192.168.150.180NETMASK=255.255.255.0NETWORK=192.168.150.0GATEWAY=192.168.150.1DNS1=192.168.150.1
还要检查/etc/udev/rules.d/70-persistent-net.rules配置文件中MAC地址是否和ifcfg-eth0一致
修改完成需要重启network服务systemctl restart network
如果是修改了/etc/udev/rules.d/70-persistent-net.rules文件,需要重启系统