centos7 prompted to restart the card wrong solution

 After today change a static ip in centOS 7 can not find network service restarted, a search of the network, tried a variety of methods, and finally resolved.

     Now all sorts of solutions to collate and I hope that the students behind the crooked road less traveled point. . .

First look at the problem: The following error occurs after execution service network restart command:

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.                                                           [失败]
根据提示输入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 五 2017-07-14 19:01:47 CST; 1min 16s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 4681 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)
   CGroup: /system.slice/network.service
           └─1192 /sbin/dhclient -H mini1 -1 -q -lf /var/lib/dhclient/dhclient--ens33.lease -pf /v...
7月 14 19:01:47 mini1 network[4681]: RTNETLINK answers: File exists
7月 14 19:01:47 mini1 network[4681]: RTNETLINK answers: File exists
7月 14 19:01:47 mini1 network[4681]: RTNETLINK answers: File exists
7月 14 19:01:47 mini1 network[4681]: RTNETLINK answers: File exists
7月 14 19:01:47 mini1 network[4681]: RTNETLINK answers: File exists
7月 14 19:01:47 mini1 network[4681]: RTNETLINK answers: File exists
7月 14 19:01:47 mini1 systemd[1]: network.service: control process exited, code=exited status=1
7月 14 19:01:47 mini1 systemd[1]: Failed to start LSB: Bring up/down networking.
7 Yue 14 19:01:47 mini1 systemd [1]: Unit network.service entered failed state.
7 Yue 19:01:47 mini1 systemd 14 [1]:. Network.service failed The
Network service will not start first of all ensure that / etc / ifcfg-xxx (not necessarily the same for each machine) there are no errors (if you altered the words), the error here refers to the process of change in the wrong hands because mistyped letters and the like under sysconfig / network-scripts directory.
Online most common types of practices are as follows:

1. NetworkManager service and there is a conflict, the good solution, directly off NetworkManger service just fine, service NetworkManager stop, and prohibiting boot chkconfig NetworkManager off. After the restart just fine.

2 MAC addresses and configuration file does not match, Ye Hao solve this, use ip addr (or ifconfig) View mac address

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    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: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:b8:e7:21 brd ff:ff:ff:ff:ff:ff
    inet 192.168.65.141/24 brd 192.168.65.255 scope global dynamic ens33
       valid_lft 1193sec preferred_lft 1193sec
    inet6 fe80::cca2:d835:f93:e637/64 scope link 
       valid_lft forever preferred_lft forever
00: 0c: 29: b8: e7: 21 This is the MAC address of the / etc / sysconfig / network-scripts / ifcfg-xxx in HWADDR (if not add on) into the MAC address

3. Set a start-up called NetworkManager-wait-online service, the command is:
systemctl enable NetworkManager-the wait-online.service

=========================================================================================================

I see the most is the two above solution, but unfortunately, I did not solve.

View Profile has found some of the following methods:

4. Check under / etc / sysconfig / network-scripts, independent of the rest of the card where the file deleted the whole, to avoid unnecessary disruption, that is, only leaving a file begins with the ifcfg,

And that should leave a name using the ip addr ip command to see the beginning of the second agreement (I was ens33, see above I posted the results of the command ip addr), so I just left a ifcfg-ens33. (One of my two machines is so somehow, because I left a backup before it is modified to delete the backup just fine ...)

5. DEVICE line ifcfg-xxx file commented.

6. ifcfg-xxx in NAME changed and the same file name.

7. edit VMWare, - in the virtual network editor to Bridged Network mode.

8. See the bottom right corner of VMWare network adapter is connected, if the connector is not connected.

Once set, the NAT bridging mode to try, I changed after the bridge you can restart the network service but unable to get online, you can restart - click on the network adapter: (Supplementary

Then bridging mode to NAT mode, can be found both online and can restart the network service)

9. Check your computer has not disabled under the VMware DHCP service and VMware NAT service vm these services, if disabled open.

10. If you changed the static ip do not forget to BOOTPROTO changed static.

11. If the above are not resolved, there is a last resort - take a look at the restart there is no miracle! ! (My inexplicable restart another one just fine)

These methods above, I basically have tried, on my machine, some helpful, some useless, but it was also used these methods to solve, so be recorded. I am hoping to give you a little help
--------------------- 
Author: the way forward 1 
Source: CSDN 
Original: https: //blog.csdn.net/weiyongle1996/ article / details / 75128239 
copyright: This article is a blogger original article, reproduced, please attach Bowen link!

Published 29 original articles · won praise 3 · Views 3405

Guess you like

Origin blog.csdn.net/qq_41601836/article/details/90171237