service network restart //重啓網絡服務網絡
Restarting network (via systemctl): Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details. [FAILED]
cat /var/log/messages //查看日誌學習
Jun 18 12:04:54 localhost network: Bringing up interface Wired_connection_1: ERROR : [/etc/sysconfig/network-scripts/ifup-eth] Device has different MAC address than expected, ignoring. Jun 18 12:04:54 localhost /etc/sysconfig/network-scripts/ifup-eth: Device has different MAC address than expected, ignoring Jun 18 12:04:54 localhost network: [FAILED] Jun 18 12:04:54 localhost network: Bringing up interface eth0: RTNETLINK answers: File exists Jun 18 12:05:06 localhost PackageKit: uid 0 is trying to obtain org.freedesktop.packagekit.system-sources-refresh auth (only_trusted:0) Jun 18 12:05:06 localhost PackageKit: uid 0 obtained auth for org.freedesktop.packagekit.system-sources-refresh Jun 18 12:05:07 localhost kernel: TCP: lp registered Jun 18 12:05:15 localhost network: [ OK ] Jun 18 12:05:15 localhost network: RTNETLINK answers: File exists Jun 18 12:05:15 localhost network: RTNETLINK answers: File exists Jun 18 12:05:15 localhost network: RTNETLINK answers: File exists Jun 18 12:05:15 localhost network: RTNETLINK answers: File exists Jun 18 12:05:15 localhost network: RTNETLINK answers: File exists Jun 18 12:05:15 localhost network: RTNETLINK answers: File exists Jun 18 12:05:15 localhost network: RTNETLINK answers: File exists Jun 18 12:05:15 localhost network: RTNETLINK answers: File exists Jun 18 12:05:15 localhost network: RTNETLINK answers: File exists Jun 18 12:05:15 localhost systemd: network.service: control process exited, code=exited status=1 Jun 18 12:05:15 localhost systemd: Failed to start LSB: Bring up/down networking. Jun 18 12:05:15 localhost systemd: Unit network.service entered failed state. Jun 18 12:05:15 localhost systemd: network.service failed.
vi /etc/sysconfig/network-scripts/ifup-eth //查看一下這個腳本 ### 找出黃色部分Device has different MAC address than expected > if [ -n "${HWADDR}" ]; then FOUNDMACADDR=$(get_hwaddr ${REALDEVICE}) if [ "${FOUNDMACADDR}" != "${HWADDR}" -a "${FOUNDMACADDR}" != "${MACADDR}" ]; then net_log $"Device ${DEVICE} has different MAC address than expected, ignoring." exit 1 fi fi
if [ -n "${HWADDR}" ]; then FOUNDMACADDR=$(get_hwaddr ${REALDEVICE}) if [ "${FOUNDMACADDR}" != "${HWADDR}" -a "${FOUNDMACADDR}" != "${MACADDR}" ]; then net_log $"Device ${DEVICE} has different MAC address than expected, ignoring." net_log $"==============start=======================" net_log $"!!!!${FOUNDMACADDR}" != "${HWADDR}" -a "${FOUNDMACADDR}" != "${MACADDR}!!!!!" net_log $"start.FOUNDMACADDR=${FOUNDMACADDR} - HWADDR=${HWADDR} - MACADDR=${MACADDR}.end" net_log $"===============ent========================" exit 1 fi fi
service network restart //重啓網絡服務 cat /var/log/messages //查看日誌測試
start.FOUNDMACADDR=00:00:00:00:00:00#01200:50:56:25:F1:F1#01252:54:00:C6:E8:77#01252:54:00:C6:E8:77 - ==HWADDR=00:0C:29:EB: D7:BF== - MACADDR=.end
MACADDR=0:0c:29:eb:d7:bf 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=eth0 DEVICE=eth0 ONBOOT=yes DNS1=8.8.8.8 IPADDR=192.168.1.109 PREFIX=24 GATEWAY=192.168.1.1 NM_CONTROLLED=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes IPV6_PRIVACY=no
###虛擬機關閉 設置網絡適配器(本人用的是橋接模式)-高級-MAC地址改爲0:0c:29:eb:d7:bf 重啓ui
service network restart //重啓網絡服務.net
[root[@localhost](https://my.oschina.net/u/570656) network-scripts]# service network restart Restarting network (via systemctl): [ OK ]