centos 使用正常的repo yum 报错连接一个很奇怪的网址,貌似是ipv6的

问题遇到的现象和发生背景

版本centos 7.9 网络使用NAT模式 拉了一个同版本系统里面的repo文件还是会报错

问题相关代码,请勿粘贴截图

yum clean all && yum makecache

运行结果及报错内容

已加载插件:fastestmirror
正在清理软件源: base elrepo epel extras updates
Cleaning up list of fastest mirrors
已加载插件:fastestmirror
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrors.elrepo.org/mirrors-elrepo.el7 error was
12: Timeout on http://mirrors.elrepo.org/mirrors-elrepo.el7: (28, 'Connection timed out after 30003 milliseconds')

One of the configured repositories failed (CentOS-7 - Base - mirrors.aliyun.com),
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://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed to connect to 240e:f7:7c00:106:3::3fe: 网络不可达"
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed to connect to 240e:f7:7c00:106:3::3fe: 网络不可达"
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed to connect to 240e:f7:7c00:106:3::3fe: 网络不可达"
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed to connect to 240e:f7:7c00:106:3::3fd: 网络不可达"
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed to connect to 240e:f7:7c00:106:3::3fd: 网络不可达"
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed to connect to 240e:f7:7c00:106:3::3fd: 网络不可达"
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: (28, 'Connection timed out after 30003 milliseconds')
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: (28, 'Connection timed out after 30002 milliseconds')
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed to connect to 240e:f7:7c00:106:3::3fd: 网络不可达"
http://mirrors.aliyun.com/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#7 - "Failed to connect to 240e:f7:7c00:106:3::3fd: 网络不可达"

我的解答思路和尝试过的方法

拉取了一个正常的使用桥接模式的系统内部的yum源

我想要达到的结果

yum源可用

试试这个
vi /etc /resolve.conf
nameserver 8.8.8.8

在CentOS 7中yum更新时默认会将源列表域名解析到IPv6地址,如网络环境不支持IPv6则可能报错。

楼主解决了吗?我也遇到这问题了