Yum 失败是因为 http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os 无法访问?

Yum 失败是因为 http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os 无法访问?

在我的Cent OS 7 VM 来宾: 尝试打开http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os在浏览器中但无法连接。甚至http://mirrorlist.centos.org不(在 Firefox 中尝试过)

[root@labipa ~]#  nslookup mirrorlist.centos.org
Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
Name:   mirrorlist.centos.org
Address: 85.236.43.108
Name:   mirrorlist.centos.org
Address: 212.69.166.138
Name:   mirrorlist.centos.org
Address: 216.176.179.218
Name:   mirrorlist.centos.org
Address: 67.219.148.138

[root@labipa ~]# 
[root@labipa ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search example.com
nameserver 8.8.8.8

[root@labipa ~]# ping -w 1 mirrorlist.centos.org
PING mirrorlist.centos.org (67.219.148.138) 56(84) bytes of data.
64 bytes from 67.219.148.138: icmp_seq=1 ttl=54 time=248 ms
64 bytes from 67.219.148.138: icmp_seq=2 ttl=54 time=249 ms

--- mirrorlist.centos.org ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 248.644/248.861/249.078/0.217 ms
[root@labipa ~]# 
[root@labipa ~]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          permissive
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28
[root@labipa ~]# 
[root@labipa ~]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
   Active: inactive (dead) since Sat 2018-05-19 00:59:21 EDT; 16min ago
  Process: 639 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 639 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/firewalld.service

May 19 00:56:31 labipa.example.com systemd[1]: Started firewalld - dynamic firewall daemon.
May 19 00:59:20 labipa.example.com systemd[1]: Stopping firewalld - dynamic firewall daemon...
May 19 00:59:21 labipa.example.com systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@labipa ~]#

Cent os 7 VM guest 内部

  • nslookup 在mirrorlist.centos.org 上工作
  • 防火墙已禁用且 selinux 设置为宽松
  • pingmirrorlist.centos.org 成功
  • 使用8.8.8.8作为DNS服务器
  • 命名服务未运行

除mirrorlist.centos.org 外,所有其他网站均打开。

[root@labipa ~]# ip route
default via 192.168.4.2 dev eth0  proto static  metric 100 
192.168.4.0/24 dev eth0  proto kernel  scope link  src 192.168.4.200  metric 100

嗯错误:

[root@labipa ~]# yum makecache
Loaded plugins: fastestmirror, langpacks
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#7 - "Failed to connect to 2604:1580:fe02:2::10: Network is unreachable"

编辑: 我的虚拟机IP192.168.4.200/24

    212.69.166.138 ( is mirrorlist.centos.org )

我从主机(192.168.1.6/24)运行wireshark(并且出现以下错误(主机被行政禁止

30  23.475234289    212.69.166.138  192.168.4.200   ICMP    102 Destination unreachable (Host administratively prohibited)
31  23.476239837    192.168.4.200   216.176.179.218 TCP 74  52579 > http [SYN] Seq=0 Win=14600 Len=0 MSS=1460 SACK_PERM=1 TSval=5955935 TSecr=0 WS=128

答案1

截至撰写本文时,mirrorlist.centos.org似乎无法通过 IPv6 进行访问。

根据手册页,您可以通过编辑以下行yum来仅解析 IPv4 地址:yum.conf

ip_resolve = IPv4

相关内容