如果您的系统正在运行 NetworkManager,则需要禁用它。
停止并禁用 NetworkManager:
systemctl stop NetworkManager systemctl disable NetworkManager systemctl enable network
我可以毫无问题地执行前两个命令。然而,第三个命令却给出了我无法理解的响应:
#systemctl enable network
network.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig network on
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
.wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).
该服务似乎处于非活动状态:
#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 Thu 2015-09-10 11:46:50 ICT; 28min ago
操作系统:CentOS Linux 版本 7.1.1503(核心)(最小安装)
答案1
以某种方式,使用#chkconfig network on
有效。
答案2
此命令对我不起作用,我的网络状态中有此信息
● network.service - LSB:启动/关闭网络 已加载:已加载(/etc/rc.d/init.d/network;已生成) 活动:失败(结果:退出代码)自 2022-12-01 星期四 18:58:46 EST 起;7 分钟 a> 文档:man:systemd-sysv-generator(8)
十二月01 18:58:45 openstack.example.com systemd[1]: 正在启动 LSB: 启动/关闭 > 停止。 01 18:58:46 openstack.example.com 网络[1498]: 接口激活> déc. 01 18:58:46 openstack.example.com 网络[1498]: 接口激活> déc. 01 18:58:46 openstack.example.com 网络[1696]: 接口激活> déc. 01 18:58:46 openstack.example.com 网络[1696]:
déc. 01 18:58:46 openstack.example.com 网络[1696]: rreur : 已从 l>déc 激活。 01 18:58:46 openstack.example.com network[1498]: rreur : 十二月 01 18:58:46 openstack.example.com systemd[1]: network.service: Control pro> 十二月 01 18: 58:46 openstack.example.com systemd[1]: network.service: 失败,原因> déc. 01 18:58:46 openstack.example.com systemd[1]: 无法启动 LSB:Bring u>