禁用和删除“NetworkManager”服务后,无法启动CentOS 7“网络”服务.
当我检查网络服务状态时,它会出现以下错误:
当我检查网络服务状态时,它会出现以下错误:
#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 Fri 2015-01-16 22:30:46 GMT; 38s ago Process: 4857 ExecStart=/etc/rc.d/init.d/network start (code=exited,status=1/FAILURE) Jan 16 22:30:46 localhost.localdomain network[4857]: RTNETLINK answers: File exists Jan 16 22:30:46 localhost.localdomain network[4857]: RTNETLINK answers: File exists Jan 16 22:30:46 localhost.localdomain network[4857]: RTNETLINK answers: File exists Jan 16 22:30:46 localhost.localdomain network[4857]: RTNETLINK answers: File exists Jan 16 22:30:46 localhost.localdomain network[4857]: RTNETLINK answers: File exists Jan 16 22:30:46 localhost.localdomain network[4857]: RTNETLINK answers: File exists Jan 16 22:30:46 localhost.localdomain network[4857]: RTNETLINK answers: File exists Jan 16 22:30:46 localhost.localdomain systemd[1]: network.service: control process exited,code=exited status=1 Jan 16 22:30:46 localhost.localdomain systemd[1]: Failed to start LSB: Bring up/down networking. Jan 16 22:30:46 localhost.localdomain systemd[1]: Unit network.service entered Failed state.
在早期的CenOS中,从“NetworkManager”服务切换到网络服务时似乎没有任何问题.
有关导致问题的原因以及如何解决问题的任何想法?
Note: I used yum erase to remove network manage service.
以下是其他信息:
/etc/sysconfig/network-script/ifcfg-enp8s0 TYPE=Ethernet BOOTPROTO=dhcp DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no NAME=enp8s0 UUID=453a07fe-1b07-4f29-bc32-f2168e50706a ONBOOT=yes HWADDR=XXXXXXXXXXX MACADDR=XXXXXXXXXX PEERDNS=yes PEERROUTES=yes IPV6_PEERDNS=yes IPV6_PEERROUTES=yes
/etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
/etc/resolv.conf ; generated by /usr/sbin/dhclient-script search customer.marples.midcity.lan nameserver 10.241.128.1
解决方法
在Centos7.0中,禁用NetworkManager将保留为NetworkManager配置的dhcp客户端运行.这会导致错误消息RTNETLINK答案:网络服务启动时存在文件.
陈旧的dhclient进程有额外的“好处”,当租约到期时你的dhclient会窒息,因为它无法访问NetWorkManager,因此删除了你的IP地址.
如果你grep它,你会看到它指向一个NetWorkManager配置文件.
[root@host ~]# ps -ef | grep dhc root 1865 792 0 Apr28 ? 00:00:00 /sbin/dhclient -d -sf \ /usr/libexec/nm-dhcp-helper -pf /var/run/dhclient-eno1.pid -lf\ /var/lib/NetworkManager/dhclient-c96e56d3-a4c9-4a87-85ca-93dc0ca268f2-eno1.lease\ -cf /var/lib/NetworkManager/dhclient-eno1.conf eno1
所以你可以做的就是杀死dhclient,然后启动你的网络服务.