Home > Article > Operation and Maintenance > Centos7 system fails to restart network card
Problem:
The following error occurs after executing the 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. [Failure]
(Recommended tutorial: centos use Tutorial )
Solution:
1. If there is a conflict with the NetworkManager service, just close the NetworkManager service directly, service NetworkManager stop, and prohibit starting chkconfig NetworkManager at boot. off. Just restart after that.
2. The MAC address does not match the configuration file. This can be easily solved. Use ip addr (or ifconfig) to check the mac address
[root@royfans royfans]# ip a 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> mtu 1500 qdisc noop state DOWN qlen 1000 link/ether 00:0c:29:5f:9e:1d brd ff:ff:ff:ff:ff:ff 3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN qlen 1000 link/ether 52:54:00:67:8e:c3 brd ff:ff:ff:ff:ff:ff inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0 valid_lft forever preferred_lft forever 4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN qlen 1000 link/ether 52:54:00:67:8e:c3 brd ff:ff:ff:ff:ff:ff
00:0c:29:5f:9e:1d This is the MAC address. Change the HWADDR in /etc/sysconfig/network-scripts/ifcfg-xxx (add it if not) to this MAC address.
3. Set to start a service named NetworkManager-wait-online after booting. The command is:
systemctl enable NetworkManager-wait-online.service
4. Check /etc/sysconfig/network-scripts and change the rest Delete all irrelevant network card location files to avoid unnecessary effects, that is, leave only one file starting with ifcfg
5. Comment out the DEVICE line in the ifcfg-xxx file.
6. Change the NAME in ifcfg-xxx to be consistent with the file name.
Related video tutorial sharing: linux video tutorial
The above is the detailed content of Centos7 system fails to restart network card. For more information, please follow other related articles on the PHP Chinese website!