虚拟机中安装好的centos不能上网

本文从问题的现状以及解决过程中问题查找以及问题解决进行描述,如下所示:

1.ping www.baidu.com上网失败

2.将虚拟机中安装好的centos网络设置成NAT

虚拟机中安装好的centos不能上网_第1张图片

3.重启网络发现重启失败

报错有:“正在打开接口 ens33: 错误:激活连接失败:No suitable device found for this connection”以及“Failed to start LSB: Bring up/down networking”,如下所示

虚拟机中安装好的centos不能上网_第2张图片

4.但是在虚拟机中安装好的centos后,不能上网ifconfig后没有ens33网卡,使用ifconfig -a查看主机上的网卡信息。

虚拟机中安装好的centos不能上网_第3张图片

5.解决方案

step01:在终端窗口中输入命令,systemctl stop NetworkManager

step01:在终端窗口中输入命令,systemctl disable NetworkManager

虚拟机中安装好的centos不能上网_第4张图片

step03:在终端窗口中输入命令,systemctl start network.service

step04:在终端窗口中输入命令,ifconfig,可以看到ens33网卡

虚拟机中安装好的centos不能上网_第5张图片

step05:在终端窗口中输入命令,ping www.baidu.com,可以上网了

虚拟机中安装好的centos不能上网_第6张图片

 

你可能感兴趣的:(Linux,大数据,架构)