centos虚拟机时我复制过来的,IP地址、mac地址都与别人的冲突,首先需要修改mac地址和ip地址。
修改ip配置 /etc/sysconfig/network-scripts/ifcfg-ens33,注意修改一下4个红色字体的参数
[root@localhost bin]# more /etc/sysconfig/network-scripts/ifcfg-ens33 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=static DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens33 UUID=a903e483-d2b3-407d-8327-3cd37d4785f2 DEVICE=ens33 ONBOOT=yes IPADDR=192.168.226.129 NETMASK=255.255.255.0 GATEWAY= DNS=192.168.226.2 HWADDR=00:50:56:3C:91:A4
然后执行systemctl restart network启动失败
解决办法:
systemctl stop NetworkManager
systemctl disable NetworkManager
reboot
systemctl start network.service