The version of the Centos7 kernel installed by me is: 3.10.0-1062.el7.x86_64 and suddenly I can’t access the Internet. According to most of the tutorials on the Internet, it is generally divided into the following steps:
1. Close the virtual machine, click - "virtual network editor, as shown below
2,. After clicking to enter, you can see the following page:
这里面有几个连接,我们经常使用的一般都是桥接或者NAT,关于这两者的详述,可以参考下这篇博文:
https://blog.csdn.net/ning521513/article/details/78441392/.
在这里面需要强调一点的是:VMmet0、VMmet1、VMnet8对应的是网络连接里面对应的网口,当你选择桥接模式时最好是桥街道自己现在正在用的网卡上,如我这里使用的是无线网,那么你双击无线网再查看详细信息就可以看到对应的网卡:
3. Then go to the network card settings in the corresponding virtual machine to find the network card settings. If the bridge is selected above, then it will be as follows:
然后还有另外一种NAT的方式就不在这里详述了,可以参考这篇博文
https://blog.csdn.net/CoderTnT/article/details/102642380
但是我这里这次尝试了很多次还是无法连上,哦还要补充一点就是现在网上说的重启VM相关服务,也尝试过了,也不行,现象就是虚拟机网口一直都是down的, 并且重启网络服务还报错。如下图:
Finally, I refer to this blog post:
https://blog.csdn.net/crazy__qu/article/details/80535950
关闭了网络防火墙,成功解决,是如下两条指令:
systemctl stop NetworkManager
systemctl disable NetworkManager