命令
service network restart
提示
Job for network.service failed because the control process exited with error code. See “systemctl status network.service” and “journalctl -xe” for details.
原因分析
使用journalctl -xe
命令查看日志后的具体错误
-- Unit network.service has begun starting up.
Oct 07 22:30:54 localhost.localdomain network[3419]: Bringing up loopback interface:
Oct 07 22:30:54 localhost.localdomain NetworkManager[572]: <info> [1696743054.2665]
Oct 07 22:30:54 localhost.localdomain network[3419]: Bringing up interface ens33: Er
Oct 07 22:30:54 localhost.localdomain network[3419]: [FAILED]
Oct 07 22:30:54 localhost.localdomain network[3419]: RTNETLINK answers: File exists
Oct 07 22:30:54 localhost.localdomain network[3419]: RTNETLINK answers: File exists
Oct 07 22:30:54 localhost.localdomain network[3419]: RTNETLINK answers: File exists
Oct 07 22:30:54 localhost.localdomain network[3419]: Bringing up interface ens33: Er
Oct 07 22:30:54 localhost.localdomain network[3419]: [FAILED]
Oct 07 22:30:54 localhost.localdomain network[3419]: RTNETLINK answers: File exists
Oct 07 22:30:54 localhost.localdomain network[3419]: RTNETLINK answers: File exists
Oct 07 22:30:54 localhost.localdomain network[3419]: RTNETLINK answers: File exists
Oct 07 22:30:54 localhost.localdomain network[3419]: RTNETLINK answers: File exists
Oct 07 22:30:54 localhost.localdomain network[3419]: RTNETLINK answers: File exists
Oct 07 22:30:54 localhost.localdomain network[3419]: RTNETLINK answers: File exists
Oct 07 22:30:54 localhost.localdomain network[3419]: RTNETLINK answers: File exists
Oct 07 22:30:54 localhost.localdomain network[3419]: RTNETLINK answers: File exists
Oct 07 22:30:54 localhost.localdomain network[3419]: RTNETLINK answers: File exists
Oct 07 22:30:54 localhost.localdomain systemd[1]: network.service: control process ex
Oct 07 22:30:54 localhost.localdomain systemd[1]: Failed to start LSB: Bring up/down
-- Subject: Unit network.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit network.service has failed.
--
-
解决办法1
大部分情况是ens33配置文件的内容错误,比如少了一个引号、DNS写成了DSN、GATEWAY写成了GATAWAY、IP格式错误等等。
修改错误内容再次重启即可。
比如这个同学,末尾少写了一个引号"
:
解决办法2
RTNETLINK answers: File exists
对于这个错误:Error: Connection activation failed: No suitable device found for this connection (device lo not available because device is strictly unmanaged).
问题原因
/etc/init.d/network
/etc/init.d/NetworkManager这两个服务有冲突。
从根本上说是NetworkMaganager(NM)的带来的冲突,停用NetworkManager即可解决。重启即可。
解决办法:
停止一次:
service NetworkManager stop
永久停止
chkconfig NetworkManager off
chkconfig network on
service NetworkManager stop
service network start
参考资料:
RTNETLINK answers: File exists错误解决方法-CSDN博客