在Arch Linux主机中无法解析Vagrant CentOS guest虚拟机的IP

时间:2016-12-20 02:20:00

标签: networking vagrant virtualbox

我有vagrantfile工作(here)。

但在更新我的Linux版本(4.4到4.8)之后。它停止解析访客地址(192.168.0.210)。我不知道这是不是原因。

我为Linux 4.8安装了VirtualBox和Kernel模块。

这些是我正在使用的版本:

  • Manjaro Linux(Arch Linux)
  • 内核4.4或4.8(我试过两者)
  • Vagrant 1.9.1
  • VirtualBox 5.1.10 r112026

当我打电话给客人时,这就是我得到的:

$ ping 192.168.0.210
PING 192.168.0.210 (192.168.0.210) 56(84) bytes of data.
From 192.168.0.1 icmp_seq=1 Destination Host Unreachable
From 192.168.0.1 icmp_seq=2 Destination Host Unreachable
From 192.168.0.1 icmp_seq=3 Destination Host Unreachable
From 192.168.0.1 icmp_seq=4 Destination Host Unreachable
From 192.168.0.1 icmp_seq=5 Destination Host Unreachable

但是,如果我直接ping网络地址,它就会成功:

$ ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.034 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=0.036 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=0.036 ms
64 bytes from 192.168.0.1: icmp_seq=4 ttl=64 time=0.035 ms
64 bytes from 192.168.0.1: icmp_seq=5 ttl=64 time=0.034 ms

这是vbox网络:

vboxnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.1  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::800:27ff:fe00:0  prefixlen 64  scopeid 0x20<link>
        ether 0a:00:27:00:00:00  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 68  bytes 8598 (8.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

在客人身上。这些是网络接口:

$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 52:54:00:d8:71:80 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic eth0
       valid_lft 85612sec preferred_lft 85612sec
    inet6 fe80::5054:ff:fed8:7180/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:20:77:0b brd ff:ff:ff:ff:ff:ff
    inet6 fe80::a00:27ff:fe20:770b/64 scope link 
       valid_lft forever preferred_lft forever

我在测试时,在主机和访客上禁用了防火墙。

有任何线索吗? 谢谢!

1 个答案:

答案 0 :(得分:0)

好的,这是Vagrant 1.9.1的一个错误(恢复到1.9.0可以正常工作)。

https://github.com/mitchellh/vagrant/issues/8142