ubuntu上虚拟机的网络实验

宿主机:ubuntu1204 desktop
虚拟机:ubuntu1204 server
虚拟化软件: virtualbox 4.1.12
虚拟机网络设置:

Adapter 1:

Intel PRO/1000 MT Desktop (Bridged adapter, eth0)


宿主机eth0没插网线,利用ifconfig设置ip如下:
#ifconfig eth0 192.168.4.2/24
#ip a 
1: lo: mtu 16436 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
    inet6 ::1/128 scope host 
        valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 20:6a:8a:39:70:d3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.4.3/24 brd 192.168.4.255 scope global eth0
3: wlan0: mtu 1500 qdisc mq state UP qlen 1000
    link/ether 20:7c:8f:61:82:27 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.103/24 brd 192.168.1.255 scope global wlan0
    inet6 fe80::227c:8fff:fe61:8227/64 scope link 
        valid_lft forever preferred_lft forever

虚拟机与宿主机的eth0桥接,虚拟机设置如下:
#ifconfig eth0 192.168.4.2/24
ubuntu上虚拟机的网络实验

虚拟机ping宿主机
# ping 192.168.4.3
此处为一直等待,没有反映。

宿主机抓包显示如下:
#tcpdump -i eth0 -n
15:19:25.452878 ARP, Request who-has 192.168.4.3 tell 192.168.4.2, length 28
15:19:26.451340 ARP, Request who-has 192.168.4.3 tell 192.168.4.2, length 28
15:19:27.451419 ARP, Request who-has 192.168.4.3 tell 192.168.4.2, length 28
15:19:28.463920 ARP, Request who-has 192.168.4.3 tell 192.168.4.2, length 28
15:19:29.463457 ARP, Request who-has 192.168.4.3 tell 192.168.4.2, length 28
15:19:30.463530 ARP, Request who-has 192.168.4.3 tell 192.168.4.2, length 28
15:19:31.463691 ARP, Request who-has 192.168.4.3 tell 192.168.4.2, length 28
15:19:32.463560 ARP, Request who-has 192.168.4.3 tell 192.168.4.2, length 28
15:19:33.463584 ARP, Request who-has 192.168.4.3 tell 192.168.4.2, length 28

宿主机ping虚拟机
#ping 192.168.4.2
此处为一直等待,没有反映。

虚拟机上抓包没有任何信息:
#tcpdump -i eth0 -n

宿主机广播
#ping 192.168.4.255 -b
此处为一直等待,没有反映。

虚拟机上抓包显示如下:
tcpdump -i eth0 -n
ubuntu上虚拟机的网络实验

问题:
为何对宿主机和虚拟机都进行了正确的IP设置,却不能相互ping通呢?

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页