欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 手游 > 【笔记】虚拟机联通不了外网 已解决

【笔记】虚拟机联通不了外网 已解决

2024/10/25 0:34:53 来源:https://blog.csdn.net/2301_81538937/article/details/140398727  浏览:    关键词:【笔记】虚拟机联通不了外网 已解决

错误:
[root@linuxlocalhost yum.repos.d]# sudo yum makecache
已加载插件:fastestmirror, langpacks
Determining fastest mirrors
http://vault.centos.org/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: vault.centos.org; 未知的错误"
正在尝试其它镜像。


 One of the configured repositories failed (CentOS-7 - Base),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=base ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable base
        or
            subscription-manager repos --disable=base

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=base.skip_if_unavailable=true

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://vault.centos.org/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: vault.centos.org; 未知的错误"

解决:

看了很多文章卡了一天一夜没有解决

最后在看这位佬的文章的时候:VMware Workstation虚拟机固定IP配置(主机互通、外网可访问)_vm虚拟机ip地址设置-CSDN博客

突然灵光一闪去查看自己网关地址

结果发现是当初刚开始学习linux的时候配置网关错误

总结来说就是这三个地方的网关要一致

第一个地方

第二个地方

第三个地方

vim  /etc/sysconfig/network-scripts/ifcfg-ens33

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com