可以在具有桥接接口的主机上 ping 但不能 wget

pab*_*lot 7 networking kvm ping wget

这让我发疯,因为我花了两天时间试图解决这个问题。

我有一个带有 KVM 和 libvirt 的 Ubuntu Server 14.04.2 LTS。我有两个来宾虚拟机:

  1. pfSense-2.2:virtio 网络接口,WAN1 - 电缆,WAN2:aDSL 和 LAN IP:192.168.2.13
  2. Ubuntu Server 14.10:ne2000 网络接口,IP:192.168.2.10(主机名:deathstar)

主机具有如下桥接接口:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto eth0
#iface eth0 inet manual

auto br0
iface br0 inet static
        address 192.168.2.10
        netmask 255.255.255.0
        network 192.168.2.0
        broadcast 192.168.2.255
        gateway 192.168.2.13
        bridge_ports eth0
        bridge_stp on
        bridge_fd 0
        bridge_maxwait 0
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 192.168.2.13
        dns-search localdomain

auto br1
iface br1 inet manual
        bridge_ports eth1
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0

auto br2
iface br2 inet manual
        bridge_ports eth2
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0
Run Code Online (Sandbox Code Playgroud)

带有 virtio 桥接接口的 pfSense 来宾工作正常,但第二个 Ubuntu 来宾只能在 ne2000 接口上正常工作,如果我使用 virtio 桥接接口,它可以完美地 ping 和解析 DNS,购买无法使用 wget 或 apt-get 访问任何站点.

没什么大不了的,我可以用ne2000忍受它,但主机现在无法访问互联网,与以前相同的症状,我可以ping和解析DNS,但无法使用wget或apt-get访问。

有趣的是,这在大约 10 天前一直运行良好,可能是某些系统更新“破坏”了主机中的某些内容,现在无法更新或访问任何站点。

我在不同的论坛上搜索了很多次,尝试禁用 IPv6(很多人报告说这解决了问题),打开和关闭了bridge_stp,在/etc/network/interfaces 文件中包含和排除了“auto eth0”等,但没有任何效果,我坚持这一点。

如您所见,DNS 和 ping 工作正常...

pablot@deathstar:~$ ping google.com
PING google.com (173.194.42.14) 56(84) bytes of data.
64 bytes from eze03s05-in-f14.1e100.net (173.194.42.14): icmp_seq=1 ttl=51 time=26.0 ms
64 bytes from eze03s05-in-f14.1e100.net (173.194.42.14): icmp_seq=2 ttl=51 time=27.4 ms
64 bytes from eze03s05-in-f14.1e100.net (173.194.42.14): icmp_seq=3 ttl=51 time=24.9 ms
64 bytes from eze03s05-in-f14.1e100.net (173.194.42.14): icmp_seq=4 ttl=51 time=24.7 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev = 24.732/25.798/27.421/1.071 ms
pablot@deathstar:~$
Run Code Online (Sandbox Code Playgroud)

但其他一切都失败了......

pablot@deathstar:~$ sudo apt-get update
0% [Connecting to ar.archive.ubuntu.com (200.236.31.4)]
Run Code Online (Sandbox Code Playgroud)

就这样结束了……

Err http://ar.archive.ubuntu.com trusty InRelease

Err http://ar.archive.ubuntu.com trusty-updates InRelease

Err http://ar.archive.ubuntu.com trusty Release.gpg
  Unable to connect to ar.archive.ubuntu.com:http:
Err http://ar.archive.ubuntu.com trusty-updates Release.gpg
  Unable to connect to ar.archive.ubuntu.com:http:
Reading package lists... Done
W: Failed to fetch http://ar.archive.ubuntu.com/ubuntu/dists/trusty/InRelease

W: Failed to fetch http://ar.archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease

W: Failed to fetch http://ar.archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg  Unable to connect to ar.archive.ubuntu.com:http:

W: Failed to fetch http://ar.archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg  Unable to connect to ar.archive.ubuntu.com:http:

W: Some index files failed to download. They have been ignored, or old ones used instead.
Run Code Online (Sandbox Code Playgroud)

这就是我用 wget 得到的......

pablot@deathstar:~$ wget google.com
--2015-03-17 10:13:20--  http://google.com/
Resolving google.com (google.com)... 173.194.42.0, 173.194.42.1, 173.194.42.9, ...
Connecting to google.com (google.com)|173.194.42.0|:80... failed: Connection timed out.
Connecting to google.com (google.com)|173.194.42.1|:80... failed: Connection timed out.
Connecting to google.com (google.com)|173.194.42.9|:80... failed: Connection timed out.
Connecting to google.com (google.com)|173.194.42.3|:80... failed: Connection timed out.
Connecting to google.com (google.com)|173.194.42.7|:80... failed: Connection timed out.
Connecting to google.com (google.com)|173.194.42.14|:80... failed: Connection timed out.
Connecting to google.com (google.com)|173.194.42.4|:80... failed: Connection timed out.
Connecting to google.com (google.com)|173.194.42.2|:80... failed: Connection timed out.
Connecting to google.com (google.com)|173.194.42.8|:80...
Run Code Online (Sandbox Code Playgroud)

我已经用全新的 pfSense 安装替换了我的防火墙(以防万一我在不知情的情况下阻止了自己)并且结果相同。我还在我的笔记本电脑上的 Virtualbox 上安装了相同的 Ubuntu 版本,并尝试使用桥接和非桥接接口,并且通过相同的防火墙在两种情况下都运行良好。

所以一切都让我觉得我的主机有一个错误的配置,它也只影响带有桥接接口的 ubuntu 安装,但找不到它。

任何帮助将不胜感激。

提前致谢,巴勃罗

Mat*_*ang 4

无论我在 kvm 服务器上使用标准 Linux 桥还是开放虚拟桥,我都会遇到同样的问题。最后我在 pfSense 网页的 VirtIO Driver Support 下找到了答案:

禁用硬件校验和卸载 对于 FreeBSD 中 VirtIO 网络驱动程序的当前 (2014-06-11) 状态,有必要在网络选项卡上的系统 > 高级下选中禁用硬件校验和卸载框,并在保存设置后手动重新启动 pfSense ,即使没有提示指示这样做,以便能够直接从 VM 主机访问受 pfSense 保护的系统(至少是其他 VM 来宾,可能是其他系统)。该问题似乎与https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=165059有关

这对我有用。


小智 0

我遇到了相同症状的问题,我的设置如下:运行本机 Ubuntu 的联想笔记本电脑。我手动创建了一个带有 USB-Enet 接口的桥接器,该接口使用 ax88179_178a 驱动程序。我使用桥接器是为了模拟连接到桥接器“另一侧”的所有内容的不良网络条件。

我能够通过网桥 ping 和 ssh 到设备,但 wget 不起作用。

我尝试按照此处所述禁用 IPv6 ,但没有成功。我也尝试过修改 mtu 设置,但没有成功。

最终对我有用的是使用笔记本电脑上的本机以太网端口作为桥接接口之一,并使用加密狗作为桥接中的第二个端口。一旦我这样做了,一切就正常了。所以对我来说,问题是我正在使用的接口的驱动程序中的错误。