Centos-network startup error RTNETLINK answers: File exists Solution

Source: Internet
Author: User
Tags domain name server

It is best to connect to the console instead of using SSH, because the network may be interrupted and you will not be able to connect to the machine.
Chkconfig -- level 35 network on
Chkconfig -- level 0123456 NetworkManager off

Service NetworkManager stop
Service network stop

Service network start
If not, restart the system.

Service network start error RTNETLINKanswers: Fileexists solved or
The RTNETLINKanswers: Fileexists error in/etc/init. d/network start occurs. (In fact, the two are equivalent. In fact, the former executes this command ).
The fault occurs in centos because the two services that start the Network Conflict:/etc/init. d/network and/etc/init. the services d/NetworkManager conflict with each other.
Basically, NetworkMaganager (NM) conflicts can be solved by disabling NetworkManager. Restart.
1. Switch to the root account and run the chkconfig command to view the startup configurations of the network and NetworkManager services;
[Wzb @ embedded ~] $ Su-root
Password:
[Root @ embedded ~] # Chkconfig -- list network
Network 0: Disable 1: Disable 2: Enable 3: Enable 4: Enable 5: Enable 6: Disable
[Root @ embedded ~] # Chkconfig -- list NetworkManager
NetworkManager 0: Disabled 1: Disabled 2: Disabled 3: enabled 4: Disabled 5: Disabled 6: Disabled
[Root @ embedded ~] #
2. Disable NetworkManager and prevent it from starting when it is started:
[Root @ embedded ~] # Chkconfig -- level123456 NetworkManager off
3. enable the network service and start the instance upon startup. In User Mode 3, 4, and 5;
[Root @ embedded ~] # Chkconfig -- level345 network on
You can also add the last line:/etc/init. d/network start by editing the vi/etc/rc. d/rc. local file.
[Root @ embedded ~] # Vi/etc/rc. d/rc. local
#! /Bin/sh
#
# This script will be executed * after * all the other init scripts.
# You can put your own initialization stuff in here if you don't
# Want to do the full Sys V style init stuff.
/Etc/init. d/network start
4. Disable NetworkManager. it is safer to restart the Network Manager remotely.
[Root @ embedded ~] # Reboot
Note: if it is not remote, you can use the following command to solve the problem. However, the above configuration will take effect after the next restart.
[Root @ embedded ~] #/Etc/init. d/NetworkManager stop // if it is remote, this will interrupt your network, that is, remote control is not allowed (equivalent to suicide)
[Root @ embedded ~] #/Etc/init. d/NetworkManager status
NetworkManager stopped
[Root @ embedded ~] #/Etc/init. d/network stop // if it is remote, this will interrupt your network, that is, remote control is not allowed (equivalent to suicide)
[Root @ embedded ~] #/Etc/init. d/network start
Pop-up loop interface: [OK]
Pop-up page eth0: [OK]
[Root @ embedded ~] #
5. Test Network: ping http://www.baidu.com/
If the ping is successful, the network is incorrect.
If the ping fails, it indicates that the network dns configuration is incorrect. If you remotely connect to your host, it indicates that the network of the host is normal, but you use an ip address. However, you cannot ping the domain name on the remote host. If you try to ping the ip address, you can ping the host. This further illustrates the dns configuration problem. All these problems are caused by network Manager, so that the DNS configuration file/etc/resolv. conf is in the default state, that is, no domain name server is configured;
You can edit the vi/etc/resolv. conf file:
Take google's Domain Name Server as an example: add the following two sentences at the end:
Search google.com
Nameserver 8.8.8.8
Save/etc/resolv. conf and exit.
Ping www.baidu.com again and find that the operation is successful.

6. Conclusion: the cause of the problem is the conflict between the services of the two configured networks. The root culprit of uninstalling NetworkManager is.
If you execute/etc/init. d/network start twice, the symptoms of the above problem will also occur. Normally,/etc/init. d/network restart should be used when the network is enabled.
(Maybe the ip address and dns configuration file of the network configuration file are the critical resources of the two Configuration Services. This may be the main cause of the conflict ).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.