一开始配置的ifcfg-ens33
[root@cdh-141 ~]# cd /etc/sysconfig/network-scripts/[root@cdh-141 network-scripts]# lsifcfg-ens33 ifdown-post ifup-aliases ifup-post inactiveifcfg-lo ifdown-ppp ifup-bnep ifup-ppp init.ipv6-globalifdown ifdown-routes ifup-eth ifup-routes network-functionsifdown-bnep ifdown-sit ifup-ippp ifup-sit network-functions-ipv6ifdown-eth ifdown-Team ifup-ipv6 ifup-Teamifdown-ippp ifdown-TeamPort ifup-isdn ifup-TeamPortifdown-ipv6 ifdown-tunnel ifup-plip ifup-tunnelifdown-isdn ifup ifup-plusb ifup-wireless[root@cdh-141 network-scripts]# more ifcfg-ens33 TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noBOOTPROTO=staticDEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noIPV6_ADDR_GEN_MODE=stable-privacyNAME=ens33UUID=c25dceec-3196-43f8-86a3-f393aa52a2a3DEVICE=ens33ONBOOT=yesDNS1=8.8.8.8DNS2=114.114.114.114IPADDR=192.168.0.141PREFIX=24GATEWAY=192.168.0.1IPV6_PEERDNS=yesIPV6_PEERROUTES=yes
问题状态:
执行 service network restart 出现以下错误
Restarting network (via systemctl): Job for network.service failed. See 'systemctl status network.service' and 'journalctl -xn' for details.
执行systemctl status network:
显示有标题的错误信息。《Failed to start LSB: Bring up/down networking.》 原因是mac地址的问题
执行ip addr显示以下ip列表:
解决方案:
修改ifcfg-ens33文件了,只修改HWADDR就可以了。接下来执行service network restart 就正常了。
修改后ifcfg-ens33
[root@cdh-141 network-scripts]# more ifcfg-ens33 TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noBOOTPROTO=staticDEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noIPV6_ADDR_GEN_MODE=stable-privacyNAME=ens33UUID=c25dceec-3196-43f8-86a3-f393aa52a2a3HWADDR=00:0c:29:93:9e:97DEVICE=ens33ONBOOT=yesDNS1=8.8.8.8DNS2=114.114.114.114IPADDR=192.168.0.141PREFIX=24GATEWAY=192.168.0.1IPV6_PEERDNS=yesIPV6_PEERROUTES=yes
备注:HWADDR配置的地址是我自己电脑ip addr显示的地址,你需要配置自己的地址。