centos系统
关闭 网卡管理服务 他和network服务冲突
service NetworkManager stop
禁掉NetworkManager服务
systemctl disable NetworkManager
rm -rf /var/lib/NetworkManager/NetworkManager.state /etc/NetworkManager/nm-system-settings.conf
网络启动时报错
[root@openstack home]# 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.
查看详细日志如下
[root@openstack home]# journalctl -xe
Mar 15 20:47:56 openstack.example.com network[102723]: RTNETLINK answers: File exists
Mar 15 20:47:56 openstack.example.com network[102723]: RTNETLINK answers: File exists
Mar 15 20:47:56 openstack.example.com network[102723]: RTNETLINK answers: File exists
Mar 15 20:47:56 openstack.example.com network[102723]: RTNETLINK answers: File exists
Mar 15 20:47:56 openstack.example.com network[102723]: RTNETLINK answers: File exists
Mar 15 20:47:56 openstack.example.com network[102723]: RTNETLINK answers: File exists
Mar 15 20:47:56 openstack.example.com systemd[1]: network.service: Control process exited, code=exited status=1
Mar 15 20:47:56 openstack.example.com systemd[1]: network.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- The unit network.service has entered the 'failed' state with result 'exit-code'.
Mar 15 20:47:56 openstack.example.com systemd[1]: Failed to start LSB: Bring up/down networking.
-- Subject: Unit network.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit network.service has failed.
--
-- The result is failed.
查看message中关于网络的一些日志,现实好像有个关于Profile_1驱动不存在
[root@openstack home]# cat /var/log/messages | grep network
Mar 15 20:49:30 openstack network[103298]: Bringing up interface Profile_1: ERROR : [/etc/sysconfig/network-scripts/ifup-eth] Device name does not seem to be present.
Mar 15 20:49:30 openstack /etc/sysconfig/network-scripts/ifup-eth[103449]: Device name does not seem to be present.
Mar 15 20:49:30 openstack network[103298]: [FAILED]
Mar 15 20:49:30 openstack network[103298]: Bringing up interface enp1s0: RTNETLINK answers: File exists
Mar 15 20:49:30 openstack network[103298]: [ OK ]
Mar 15 20:49:30 openstack network[103298]: RTNETLINK answers: File exists
Mar 15 20:49:30 openstack network[103298]: RTNETLINK answers: File exists
Mar 15 20:49:30 openstack network[103298]: RTNETLINK answers: File exists
查看 /etc/sysconfig/network-scripts/,确实多了一个ifcfg-Profile_1
[root@openstack home]# cd /etc/sysconfig/network-scripts/
[root@openstack network-scripts]# ls
ifcfg-Profile_1 ifdown-Team ifdown-ippp ifdown-routes ifup-Team ifup-eth ifup-plip ifup-sit network-functions
ifcfg-enp1s0 ifdown-TeamPort ifdown-ipv6 ifdown-sit ifup-TeamPort ifup-ippp ifup-plusb ifup-tunnel network-functions-ipv6
ifcfg-lo ifdown-bnep ifdown-isdn ifdown-tunnel ifup-aliases ifup-ipv6 ifup-post ifup-wireless
ifdown ifdown-eth ifdown-post ifup ifup-bnep ifup-isdn ifup-routes init.ipv6-global
删除该文件重新启动网络即回复正常
[root@openstack network-scripts]# systemctl restart network
[root@openstack network-scripts]# systemctl status network.service
● network.service - LSB: Bring up/down networking
Loaded: loaded (/etc/rc.d/init.d/network; generated)
Active: active (exited) since Mon 2021-03-15 20:56:10 CST; 7min ago
Docs: man:systemd-sysv-generator(8)
Process: 103903 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=0/SUCCESS)
原文链接:https://blog.csdn.net/qq_25650463/article/details/114851257