无法ping内部连接的vm

时间:2014-09-13 17:12:00

标签: networking virtual-machine virtualbox ping ifconfig

我有三个虚拟机运行vms。
 
第一个(VM1)有两个网络适配器设置为:内部网络。假设第一个适配器(eth19)连接到内部网络,名称为" int1"第二个适配器(eth20)连接到名为" int2"的内部网络。  
 
第二个虚拟机(VM2)有一个网络适配器(eth21),它连接到内部网络,名称为" int1"最后,第三个虚拟机(VM3)有一个网络适配器(eth25)连接到内部网络,名称为" int2"。

我手动设置IP地址,如下所示

(VM1): ifconfig eth19 10.0.0.1
       ifconfig eth20 10.0.0.10
output:
eth19 Link encap:Ethernet  HWaddr 08:00:27:e1:ad:2b  
      inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
      inet6 addr: fe80::a00:27ff:fee1:ad2b/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:14 errors:0 dropped:0 overruns:0 frame:0
      TX packets:94 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:1259 (1.2 KiB)  TX bytes:10022 (9.7 KiB)

eth20 Link encap:Ethernet  HWaddr 08:00:27:e9:66:66  
      inet addr:10.0.0.10  Bcast:10.0.0.255  Mask:255.255.255.0
      inet6 addr: fe80::a00:27ff:fee9:6666/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:25 errors:0 dropped:0 overruns:0 frame:0
      TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:5741 (5.6 KiB)  TX bytes:6775 (6.6 KiB)

 Kernel IP routing table
 Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
 10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth19
 10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth20


(VM2): ifconfig eth21 10.0.0.2

eth21 Link encap:Ethernet  HWaddr 08:00:27:65:7b:83  
      inet addr:10.0.0.2  Bcast:10.0.0.255  Mask:255.255.255.0
      inet6 addr: fe80::a00:27ff:fe65:7b83/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:85 errors:0 dropped:0 overruns:0 frame:0
      TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:10002 (9.7 KiB)  TX bytes:7816 (7.6 KiB)

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth21



(VM3): ifconfig eth25 10.0.0.3

eth25 Link encap:Ethernet  HWaddr 08:00:27:ae:77:cd  
      inet addr:10.0.0.3  Bcast:10.0.0.255  Mask:255.255.255.0
      inet6 addr: fe80::a00:27ff:feae:77cd/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:0 (0.0 B)  TX bytes:6303 (6.1 KiB)

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth25

我可以从VM1 ping到VM2,从VM2 ping到VM1,但我不能ping VM3。

从VM1 ping到VM3:

ping 10.0.0.3
PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
From 10.0.0.1 icmp_seq=3 Destination Host Unreachable

什么可能是错的?

EDIT
    arping VM1到VM3

arping -I eth20 -c 2 10.0.0.3
ARPING 10.0.0.3
60 bytes from 08:00:27:ae:77:cd (10.0.0.3): index=0 time=667.000 usec
60 bytes from 08:00:27:ae:77:cd (10.0.0.3): index=1 time=448.000 usec

--- 10.0.0.3 statistics ---
2 packets transmitted, 2 packets received,   0% unanswered (0 extra)

将VM1变为VM2

arping -I eth19 -c 2 10.0.0.2
ARPING 10.0.0.2
60 bytes from 08:00:27:65:7b:83 (10.0.0.2): index=0 time=330.000 usec
60 bytes from 08:00:27:65:7b:83 (10.0.0.2): index=1 time=622.000 usec

--- 10.0.0.2 statistics ---
2 packets transmitted, 2 packets received,   0% unanswered (0 extra)

0 个答案:

没有答案