每次我通过主机名从另一个虚拟机 ping 我的一台虚拟机时,我都会得到一个不同的 IP 地址解析...
两台虚拟机都是在 VMware Workstation 10 上运行的 Ubuntu 12.04。所有虚拟机都使用桥接网络运行,包括主机在内都使用 DHCP。主机是 Windows 8.1,涉及的所有虚拟机都是 Ubuntu 12.04。
无法 ping ci-server 的这个 VM 是从另一个运行良好的 Ubuntu VM 克隆的。
我正在 ping 的是 ci-server。这是 ping 输出:
administrator@ubuntu-x64-cr:~$ ping ci-server
PING ci-server.att.net (192.168.1.179) 56(84) bytes of data.
--- ci-server.att.net ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2008ms
administrator@ubuntu-x64-cr:~$ ping ci-server
PING ci-server.att.net (192.168.1.182) 56(84) bytes of data.
--- ci-server.att.net ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2000ms
administrator@ubuntu-x64-cr:~$ ping ci-server
PING ci-server.att.net (192.168.1.206) 56(84) bytes of data.
--- ci-server.att.net ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 999ms
ci-server 上的正确 IP 地址是 192.168.1.214。
有人知道这是怎么发生的吗?特别是,我该如何解决这个问题?
更新:
这是我正在尝试 ping 的虚拟机从网络设置:
administrator@ubuntu-x64-cr:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:0c:29:9c:fc:87
inet addr:192.168.1.203 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe9c:fc87/64 Scope:Link
inet6 addr: 2602:306:c49b:1280:20c:29ff:fe9c:fc87/64 Scope:Global
inet6 addr: 2602:306:c49b:1280:1014:ca10:2b9b:68f/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:25683 errors:0 dropped:0 overruns:0 frame:0
TX packets:734 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1656255 (1.6 MB) TX bytes:93217 (93.2 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:303 errors:0 dropped:0 overruns:0 frame:0
TX packets:303 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:30322 (30.3 KB) TX bytes:30322 (30.3 KB)
奇怪的是,当我尝试关闭这个接口时,我发现它没有配置......这很奇怪。
administrator@ubuntu-x64-cr:~$ sudo ifdown eth0
ifdown: interface eth0 not configured
更新2 我又执行了几次 ping,然后执行了 arp -an。表格如下所示:
administrator@ubuntu-x64-cr:~$ arp -an
? (192.168.1.254) at 90:b1:34:96:09:10 [ether] on eth0
? (192.168.1.214) at 00:0c:29:24:60:09 [ether] on eth0
? (192.168.1.157) at <incomplete> on eth0
? (192.168.1.158) at <incomplete> on eth0
? (192.168.1.156) at <incomplete> on eth0
有趣的是,最后这 3 个 IP 地址是 ci-server(我的 Ping 的目标)解析的地址。
如果我使用目标服务器的 IP 进行 ping 操作,它可以正常工作。
我尝试通过将 eth0 设置为与 /etc/network/interfaces 中的 VM 的 MAC 地址匹配来更改操作系统的 MAC 地址,但这没有帮助......结果相同。
更新 3
以下是有关名称解析的更多信息:
administrator@ubuntu-x64-ff:~$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
和
administrator@ubuntu-x64-ff:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 ubuntu
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
此外,根据要求:
administrator@ubuntu-x64-ff:~$ dig 127.0.0.1 ci-server
; <<>> DiG 9.8.1-P1 <<>> 127.0.0.1 ci-server
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37070
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;127.0.0.1. IN A
;; ANSWER SECTION:
127.0.0.1. 0 IN A 127.0.0.1
;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Nov 17 09:43:43 2013
;; MSG SIZE rcvd: 43
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54267
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 19, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;ci-server. IN A
;; ANSWER SECTION:
ci-server. 0 IN A 192.168.1.164
ci-server. 0 IN A 192.168.1.166
ci-server. 0 IN A 192.168.1.168
ci-server. 0 IN A 192.168.1.171
ci-server. 0 IN A 192.168.1.173
ci-server. 0 IN A 192.168.1.174
ci-server. 0 IN A 192.168.1.176
ci-server. 0 IN A 192.168.1.178
ci-server. 0 IN A 192.168.1.179
ci-server. 0 IN A 192.168.1.182
ci-server. 0 IN A 192.168.1.206
ci-server. 0 IN A 192.168.1.207
ci-server. 0 IN A 192.168.1.209
ci-server. 0 IN A 192.168.1.214
ci-server. 0 IN A 192.168.1.157
ci-server. 0 IN A 192.168.1.158
ci-server. 0 IN A 192.168.1.159
ci-server. 0 IN A 192.168.1.161
ci-server. 0 IN A 192.168.1.162
;; Query time: 4 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Nov 17 09:43:43 2013
;; MSG SIZE rcvd: 331
关于为什么每次 ping ci-server 时它都会解析为不同的 IP,有什么建议或想法吗?
谢谢你!!
爱德华多