Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that the network cannot be started under CentOS7

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to solve the problem that you can't start the network under CentOS7". Interested friends might as well take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to solve the problem that you can't start the network under CentOS7.

Today, after changing the static ip under CentOS 7, I found that the network service could not be restarted. I searched the network, tried various methods, and finally solved it.

Now all kinds of solutions are summarized and sorted out in the hope that the students behind can take less crooked paths.

First, let's look at the problem: the following error occurred after executing the systemctl start network command:

$systemctl start network

Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl-xe" for details.

The following error message appears when prompted to enter the systemctl status network command:

$systemctl status network

● 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 Tue 2018-10-09 22:47:07 CST; 2min 5s ago

Docs: man:systemd-sysv-generator (8)

Process: 8980 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

Oct 09 22:47:07 Server01 network [8980]: RTNETLINK answers: File exists

Oct 09 22:47:07 Server01 network [8980]: RTNETLINK answers: File exists

Oct 09 22:47:07 Server01 network [8980]: RTNETLINK answers: File exists

Oct 09 22:47:07 Server01 network [8980]: RTNETLINK answers: File exists

Oct 09 22:47:07 Server01 network [8980]: RTNETLINK answers: File exists

Oct 09 22:47:07 Server01 network [8980]: RTNETLINK answers: File exists

Oct 09 22:47:07 Server01 systemd [1]: network.service: control process exited, code=exited status=1

Oct 09 22:47:07 Server01 systemd [1]: Failed to start LSB: Bring up/down networking.

Oct 09 22:47:07 Server01 systemd [1]: Unit network.service entered failed state.

Oct 09 22:47:07 Server01 systemd [1]: network.service failed.

The network service does not start first to guarantee that the ifcfg-xxx in the / etc/sysconfig/network-scripts directory (not necessarily the same on each machine) is error-free (if you have changed it), which refers to the mistyping of letters during the change process.

The most common practices on the Internet are as follows:

1. There is a conflict with the NetworkManager service, which is easy to resolve. Just shut down the NetworkManger service directly, systemctl stop NetworkManager, and forbid to boot and start chkconfig NetworkManager off. Just restart it after that.

2. It does not match the MAC address of the configuration file, which is easy to solve. Use ip addr (or ifconfig) to check the mac address.

$ip addr

1: lo: mtu 65536 qdisc noqueue state UNKNOWN

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: mtu 1500 qdisc pfifo_fast state UP qlen 1000

Link/ether 00:0c:29:b1:44:a0 brd ff:ff:ff:ff:ff:ff

Inet 192.168.1.102/24 brd 192.168.1.255 scope global ens33

Valid_lft forever preferred_lft forever

Inet6 fe80::20c:29ff:feb1:44a0/64 scope link

Valid_lft forever preferred_lft forever

3: br-3097ed36fd04: mtu 1500 qdisc noqueue state DOWN

Link/ether 02:42:e3:f2:63:74 brd ff:ff:ff:ff:ff:ff

Inet 172.25.0.1/16 brd 172.25.255.255 scope global br-3097ed36fd04

Valid_lft forever preferred_lft forever

4: br-4d153d29100f: mtu 1500 qdisc noqueue state DOWN

Link/ether 02:42:29:e8:35:29 brd ff:ff:ff:ff:ff:ff

Inet 172.19.0.1/16 brd 172.19.255.255 scope global br-4d153d29100f

Valid_lft forever preferred_lft forever

Inet6 fe80::42:29ff:fee8:3529/64 scope link

Valid_lft forever preferred_lft forever

The 00:0c:29:b1:44:a0 under the ens33 above is the MAC address, and will

The HWADDR in / etc/sysconfig/network-scripts/ifcfg-xxx (if not, add it) is changed to this MAC address.

3. Set the boot to start a service called NetworkManager-wait-online, and the command is:

Systemctl enable NetworkManager-wait-online.service

The above two are the solutions I see most, but unfortunately, mine didn't solve them. I have looked at the data and found the following methods:

4. Under / etc/sysconfig/network-scripts, there should be an ifcfg-xxx file. Xxx should be the same as using the ip addr command to check the name at the beginning of the second article of ip (mine is ens33, see the execution result of the ip addr command posted above), so there must be an ifcfg-ens33 in which the network information is configured. (my only ifcfg-eno16777736 file, because it is a cloned virtual machine. Need to change ifcfg-eno16777736 to ifcfg-ens33)

5. Change the DEVICE and NAME in the ifcfg-xxx file to xxx, if I need to change it to ens33

4 and 5 solved my problem.

6. Change the network mode to bridging in the editor-virtual network editor of VMWare.

7. See if the network adapter in the lower right corner of the VMWare is connected, and if not, connect it.

(add: click Network Adapter-set, and change the NAT mode to bridging to try. Mine can restart the network service after bridging, but can not get on the network. After restarting,

Then change the bridge mode to NAT mode, and find that you can both access the Internet and restart the network service)

8. Check to see if your computer has disabled VMware DHCP service and VMware NAT service vm services, and turn them on if it is disabled.

9. If you change to static ip, don't forget to change BOOTPROTO to static.

10. If the above is not solved, there is one last move-- > > restart to see if there are any miracles! (it would be better if my other one was rebooted.)

I have basically tried all of the above methods, some useful and some useless for my machine, but some people also use these methods to solve, so record them at the same time. I hope I can give you some help.

At this point, I believe you have a deeper understanding of "how to solve the problem that you can't start the network under CentOS7". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report