三種方法解決 Job for network.service failed. See 'system

Failed to start LSB: Bring up/down networking 問題
 

1、執行 service network restart 出現以下錯誤

Restarting network (via systemctl):  Job for network.service failed. See 'systemctl status network.service' and 'journalctl -xn' for details.

2、根據上面的提示,執行“systemctl status network.service”輸出以下的類似信息:

[root@localhost ~]# systemctl status network.service

network.service - LSB: Bring up/down networking

   Loaded: loaded (/etc/rc.d/init.d/network)

   Active: failed (Result: exit-code) since三 2014-11-05 15:30:10 CST; 1min 5s ago

 

11月 05 15:30:10 localhost.localdomain network[2920]: RTNETLINK answers: File exists

11月 05 15:30:10 localhost.localdomain network[2920]: RTNETLINK answers: File exists

11月 05 15:30:10 localhost.localdomain network[2920]: RTNETLINK answers: File exists

11月 05 15:30:10 localhost.localdomain network[2920]: RTNETLINK answers: File exists

11月 05 15:30:10 localhost.localdomain network[2920]: RTNETLINK answers: File exists

11月 05 15:30:10 localhost.localdomain network[2920]: RTNETLINK answers: File exists

11月 05 15:30:10 localhost.localdomain network[2920]: RTNETLINK answers: File exists

11月 05 15:30:10 localhost.localdomain systemd[1]: network.service: control process exited, code=exited status=1

11月 05 15:30:10 localhost.localdomain systemd[1]: Failed to start LSB: Bring up/down networking.

11月 05 15:30:10 localhost.localdomain systemd[1]: Unit network.service entered failed state.

3、解決的辦法(由於centos7中沒有70-persistent-net.rules這個文件,複製出來的虛擬機(vmware)需要修改mac地址),就是修改mac地址。

 

4、如何查看centos7複製出來的虛擬機的mac地址,需要執行 “ip addr”,輸出如下的類似信息:

[root@localhost ~]# ip addr

1: lo:

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

       valid_lft forever preferred_lft forever

    inet6 ::1/128 scope host

       valid_lft forever preferred_lft forever

2: eno16777736:

    link/ether00:0f:19:10:12:f1 brd ff:ff:ff:ff:ff:ff

    inet 192.168.38.135/24 brd 192.168.38.255 scope global dynamic eno16777736

       valid_lft 1681sec preferred_lft 1681sec

    inet6 fe80::20c:11aa:ae11:4fe4/64 scope link

       valid_lft forever preferred_lft forever

 

注意上面加粗加紅的字,這就是新的mac地址。

接下來就剩下修改ifcfg-XXX文件了,只修改HWADDR就可以了。接下來執行service network restart就正常了。

 

《二》

如果還是啓動失敗    查看是否有如下錯誤信息

Nov 23 22:09:07 hdcoe02 network[597]: Bringing up loopback interface:  Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'  

Nov 23 22:09:07 hdcoe02 network[597]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo' 

Nov 23 22:09:08 hdcoe02 network[597]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo' 

Nov 23 22:09:08 hdcoe02 network[597]: Could not load file '/etc/sysconfig/network-scripts/ifcfg-lo'  Nov 23 22:09:08 hdcoe02 network[597]: [  OK  ] 

Nov 23 22:09:08 hdcoe02 network[597]: Bringing up interface enp0s25:  Error: Connection activation failed: Connection 'enp0s25' is not available on the device enp0s25 at this time. 

設定開機啓動一個名爲NetworkManager-wait-online服務,命令爲:

systemctl enable NetworkManager-wait-online.service

《三》

我也是上面方法都測試完了 一直不成功,最後發現時因爲在VMware 虛擬機裏面的系統  右上角顯示的連接都沒有連接上,雖然報錯都一樣,最後我在虛擬機設置裏面將原來的網絡適配器刪掉,重新建了一個新的網絡適配器,這次進去,顯示連接成功,再用上面的方法,問題解決。

 

要瘋了!!!!今天又出現了這樣的提示;但用了上面的方法還是沒有效果,查看日誌也是找不到蛛絲馬跡,最後只能Google,

在一個博客上找到了我需要的答案,就是簡單的關閉網絡服務,然後再加載服務,然後再重啓就好了,難道Centos的一個BUG??

[root@CT71 ~]# systemctl status network.service
● network.service - LSB: Bring up/down networking
Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2017-08-04 08:20:31 CST; 1min 44s ago
Docs: man:systemd-sysv-generator(8)
Process: 62726 ExecStop=/etc/rc.d/init.d/network stop (code=exited, status=0/SUCCESS)
Process: 63183 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

Aug 04 08:20:31 CT71 network[63183]: RTNETLINK answers: File exists
Aug 04 08:20:31 CT71 network[63183]: RTNETLINK answers: File exists
Aug 04 08:20:31 CT71 network[63183]: RTNETLINK answers: File exists
Aug 04 08:20:31 CT71 network[63183]: RTNETLINK answers: File exists
Aug 04 08:20:31 CT71 network[63183]: RTNETLINK answers: File exists
Aug 04 08:20:31 CT71 network[63183]: RTNETLINK answers: File exists
Aug 04 08:20:31 CT71 systemd[1]: network.service: control process exited, code=exited status=1
Aug 04 08:20:31 CT71 systemd[1]: Failed to start LSB: Bring up/down networking.
Aug 04 08:20:31 CT71 systemd[1]: Unit network.service entered failed state.
Aug 04 08:20:31 CT71 systemd[1]: network.service failed.
如下:

systemctl stop NetworkManager
我在執行上面一步後就已經解決了問題,那個博客給出的答案還有下面的步驟,我沒有用:

systemctl disable NetworkManager

Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.

然後重啓網絡:

systemctl start network.service
可以使用了:

[root@123 bin]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.10.128 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::20c:29ff:fe84:b4 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:84:00:b4 txqueuelen 1000 (Ethernet)
RX packets 3629648 bytes 315562709 (300.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2974 bytes 295864 (288.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 90 bytes 6748 (6.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 90 bytes 6748 (6.5 KiB)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章