# Virtualbox guests unable to ping(ICMP) web addresses on NAT.



## mzs47 (Dec 28, 2018)

I have two VM guests on a FreeBSD 11.2 host running emulators/virtualbox-ose, one is Debian 9 and another FreeBSD 12. Both VMs have two interfaces one NAT, another host only.
Access to internet works(via NAT of Vbox) and I am able to resolve addresses and install packages, however `ping` to a website/public address fails to get a reply(pong) on either of them via this NAT network. These guests get a pong on host only network.

I am sharing shell snippet from both guests below, I first ping the VM host IP(192.168.56.1) which is connected to the host only adapter and later gnu.org, which gets resolved via NAT and should get a reply, but no pong comes back.

Debian 9 guest:


```
ping -c 3 192.168.56.1
PING 192.168.56.1 (192.168.56.1) 56(84) bytes of data.
64 bytes from 192.168.56.1: icmp_seq=1 ttl=64 time=0.311 ms
64 bytes from 192.168.56.1: icmp_seq=2 ttl=64 time=0.464 ms
64 bytes from 192.168.56.1: icmp_seq=3 ttl=64 time=0.849 ms

--- 192.168.56.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2032ms
rtt min/avg/max/mdev = 0.311/0.541/0.849/0.227 ms

debian:~$ ping -c 3 gnu.org
PING gnu.org (208.118.235.148) 56(84) bytes of data.

--- gnu.org ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2041ms
```

FreeBSD 12 guest:



```
ping -c 3 192.168.56.1
PING 192.168.56.1 (192.168.56.1): 56 data bytes
64 bytes from 192.168.56.1: icmp_seq=0 ttl=64 time=0.373 ms
64 bytes from 192.168.56.1: icmp_seq=1 ttl=64 time=0.658 ms
64 bytes from 192.168.56.1: icmp_seq=2 ttl=64 time=1.569 ms

--- 192.168.56.1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.373/0.867/1.569/0.510 ms


fbsd0:~ % ping -c 3 gnu.org
PING gnu.org (208.118.235.148): 56 data bytes

--- gnu.org ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
```


----------



## johnblue (Jan 4, 2019)

There could be other factors in play but what does the v12 guest think it default route is?

`netstat -r`


----------



## mzs47 (May 26, 2019)

johnblue thanks for the reply, it is the usual:



```
% netstat -r
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
default            10.0.2.2           UGS      vtnet0
10.0.2.0/24        link#1             U        vtnet0
10.0.2.15          link#1             UHS         lo0
localhost          link#3             UH          lo0
192.168.56.0/24    link#2             U        vtnet1
fbsd12             link#2             UHS         lo0

Internet6:
Destination        Gateway            Flags     Netif Expire
::/96              localhost          UGRS        lo0
localhost          link#3             UH          lo0
::ffff:0.0.0.0/96  localhost          UGRS        lo0
fe80::/10          localhost          UGRS        lo0
fe80::%lo0/64      link#3             U           lo0
fe80::1%lo0        link#3             UHS         lo0
ff02::/16          localhost          UGRS        lo0
```


----------



## keleathi (May 26, 2019)

I just ran into something really similar involving Virtualbox conflicting with if_bridge and not passing ARP replies in, but allowing ARP requests out, and other packets in.

What does a tcpdump on the host and guests give you?
On host:
`tcpdump -ni <external_if> host <IP_of_VM_Guest>`

On guest:
`tcpdump -ni <guest_if> host <IP_of_VM_Guest>`


----------

