natnetwork on Windows host: can't ping, but have network

Discussions related to using VirtualBox on Windows hosts.
Post Reply
jack.chen.toronto
Posts: 6
Joined: 20. Feb 2014, 18:05

natnetwork on Windows host: can't ping, but have network

Post by jack.chen.toronto »

Just started to try virtualbox, installed it on a Windows 2008. I am a newbie for virtualbox ( but familiar with vmware player and vshpere network and Linux network).

I am having problem on natnetwork now : from the VM, I can't ping ANY ip except the natnetwork gateway, but the vm actually has internet and can access any outside port, just can't ping.

My configuration:
C:\Program Files\Oracle\VirtualBox>VBoxManage list natnetworks
NetworkName: PN1
IP: 172.16.100.1
Network: 172.16.100/24
IPv6 Enabled: No
IPv6 Prefix:
DHCP Enabled: No
Enabled: Yes
Port-forwarding (ipv4)
ssh:tcp:[]:22:[172.16.100.102]:22
loopback mappings (ipv4)
127.0.0.1=2


question 1: where is this 172.16.100.1 gateway IP?

virtualbox has a adapter for hosted network:

Ethernet adapter VirtualBox Host-Only Network:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::5089:daf1:a1fb:bad9%15
IPv4 Address. . . . . . . . . . . : 192.168.56.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

but it doesn't have a virtual adapter for natnetwork.



The VM is a SuseLinux VM with IP 172.16.100.102, it's configured on the PN1 Nat network. I can actually ssh into this VM with the 22 port forwarding.


From the Suse VM:

va:~ # ifconfig eth0
eth0 Link encap:Ethernet HWaddr 08:00:27:DB:32:6E
inet addr:172.16.100.102 Bcast:172.16.100.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fedb:326e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:709 errors:0 dropped:0 overruns:0 frame:0
TX packets:1196 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:290397 (283.5 Kb) TX bytes:128300 (125.2 Kb)

va:~ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 172.16.100.1 0.0.0.0 UG 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
link-local * 255.255.0.0 U 0 0 0 eth0
172.16.100.0 * 255.255.255.0 U 0 0 0 eth0

va:~ #
va:~ # ping 172.16.100.1
PING 172.16.100.1 (172.16.100.1) 56(84) bytes of data.
64 bytes from 172.16.100.1: icmp_seq=1 ttl=255 time=2.27 ms
64 bytes from 172.16.100.1: icmp_seq=2 ttl=255 time=0.860 ms
^C

It can ping 172.16.100.1 ( where is it? )

va:~ #
va:~ # ping 10.4.117.32
PING 10.4.117.32 (10.4.117.32) 56(84) bytes of data.
^C

Can't ping 10.4.117.32 ( virtualbox windows 2008 host's real IP)

va:~ #
va:~ # ping 10.4.38.140
PING 10.4.38.140 (10.4.38.140) 56(84) bytes of data.
^C

Can't ping another machine in our network

va:~ # ping google dot com
PING google dot com (173.194.115.65) 56(84) bytes of data.
^C

Can't ping google, dns is working fine.


va:~ # wget 10.4.38.140

Connecting to 10.4.38.140:80... connected.

Length: 37500 (37K) [text/html]
Saving to: `index.html'
2014-02-20 11:30:28 (19.7 MB/s) - `index.html' saved [37500/37500]

Can access 10.4.38.140's website.


va:~ # telnet 10.4.38.140 22
Trying 10.4.38.140...
Connected to 10.4.38.140.
Escape character is '^]'.
SSH-2.0-OpenSSH_4.3
^]

Can access 10.4.38.140's port 22.

va:~ # telnet 10.4.38.140 732
Trying 10.4.38.140...
Connected to 10.4.38.140.
Escape character is '^]'.
^]

Can access non-standard port.

va:~ # telnet 10.4.117.32 3389
Trying 10.4.117.32...
Connected to 10.4.117.32.
Escape character is '^]'.
^]

Can access VB host's port 3389.

va:~ # netstat -nap | grep tcp | grep EST
tcp 0 48 172.16.100.102:22 10.4.38.140:35563 ESTABLISHED 3254/sshd: setup [p

I actually ssh into this VM from 10.4.38.140 by "ssh setup@10.4.117.32"

I run wireshark on the VB host to catch ICMP package, but couldn't see anything when I run "ping" command from the VM.

Almost like the VB natnetwork driver is dropping the ping package. I am using 4.3.6-91406
jack.chen.toronto
Posts: 6
Joined: 20. Feb 2014, 18:05

Re: natnetwork on Windows host: can't ping, but have network

Post by jack.chen.toronto »

When I run "ping 10.4.38.140" from this VM, tcpdump shows

va:~ # tcpdump -n icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
12:12:50.922062 IP 172.16.100.102 > 10.4.38.140: ICMP echo request, id 4655, seq 1, length 64
12:12:51.924328 IP 172.16.100.102 > 10.4.38.140: ICMP echo request, id 4655, seq 2, length 64

so it did send out it to VM's eth0. but I don't see it on VB host's wireshark.


on the VB host, it can't ping any 172 ip:
C:\Program Files\Oracle\VirtualBox>ping 172.16.100.1

Pinging 172.16.100.1 with 32 bytes of data:
Control-C
^C

C:\Program Files\Oracle\VirtualBox>ping 172.16.100.102
Pinging 172.16.100.102 with 32 bytes of data:
Control-C

also can't ssh into 172.16.100.102.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: natnetwork on Windows host: can't ping, but have network

Post by Perryg »

http://www.virtualbox.org/manual/ch06.h ... at_service

Also make sure ICMP is enabled and firewall/s are configures properly.
jack.chen.toronto
Posts: 6
Joined: 20. Feb 2014, 18:05

Re: natnetwork on Windows host: can't ping, but have network

Post by jack.chen.toronto »

Thanks Perryg.

I already followed the document to set the natnetwork:

C:\Program Files\Oracle\VirtualBox>VBoxManage list natnetworks
NetworkName: PN1
IP: 172.16.100.1
Network: 172.16.100/24
IPv6 Enabled: No
IPv6 Prefix:
DHCP Enabled: No
Enabled: Yes
Port-forwarding (ipv4)
ssh:tcp:[]:22:[172.16.100.102]:22
loopback mappings (ipv4)
127.0.0.1=2

And it is working fine except ping ( I can ssh into the VM by VB host IP:port 22).



How do I make sure ICMP is enabled?

filewalls shouldn't be problem ( windows firewall on VB host was shutdown, and and iptables on VB VM allow ping, I just shut it down, still same result).

The puzzle for me is when using natnetwork, looks like VB didn't put the gateway IP on the host, so I can't even ping VM IP 172.16.100.102 from VB host.
jack.chen.toronto
Posts: 6
Joined: 20. Feb 2014, 18:05

Re: natnetwork on Windows host: can't ping, but have network

Post by jack.chen.toronto »

some people have same problem:

viewtopic.php?f=2&t=58976&p=274162

DNS lookup is working in nat network, ping doesn't. Guess this is a bug in the experimental service, too bad :-(
Post Reply