使用NAT模式的虚拟centos, 只显示两个网卡,无法连接外网,

输入systemctl start network后报错信息"

Restarting network (via systemctl): Job for network.service failed because the control process exited with error code.
See “systemctl status network.service” and “journalctl -xe” for details
禁掉系统自带的NetworkManager服务就可解决

systemctl stop NetworkManager # 停止NetworkManager服务
systemctl disable NetworkManager # 设置开机不启动
systemctl start network # 启动网络服务

或者

停掉NetworkManager
service NetworkManager stop
chkconfig NetworkManager off

重启网络
systemctl restart network

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐