I'm using a host-only network with VirtualBox on macOS Sierra, my guests are Ubuntu. My Host (192.168.56.1) can ping both Guest A (192.168.56.100) and Guest B (192.168.56.101). Each guest can ping Host, but guests can't ping each other.
Guest A routing table:
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.56.1 0.0.0.0 UG 0 0 0 enp0s3
192.168.56.0 0.0.0.0 255.255.255.0 U 0 0 0 enp0s3Guest B routing table:
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.56.1 0.0.0.0 UG 100 0 0 enp0s3
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 enp0s3
192.168.56.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3Because Host can talk to guests and each guest can talk to Host, I get a feeling that the host is not forwarding traffic between the guests.
1 Answer
My issue was that I was using 192.168.56.100 for Guest A. On VirtualBox's default configuration, that IP is already used for the DHCP server in vboxnet0.
I changed the guest's IP to an unused one and Guest A and Guest B could then talk to each other.
This wouldn't happen if you're using DHCP for your guests as VBox won't assign 192.168.56.100. You would only enounter this issue if you were setting static IPs for your guests like I did.