I have to configure different Virtualbox guest systems (ubuntu) via Host-Only Network Adapter. The host network is configured with IP "192.168.7.1".
The clients are configured like this (/etc/network/interfaces):
# The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 192.168.7.101 netmask 255.255.255.0 gateway 192.168.7.1 up ip addr add 126.96.36.199/32 dev eth0 down ip addr del 188.8.131.52/32 dev eth0
IP forwarding is activated, port forwarding is done via
iptables -t nat -I PREROUTING -d 184.108.40.206 -j DNAT --to 192.168.7.101 iptables -t nat -I POSTROUTING -s 192.168.7.101 -j SNAT --to 220.127.116.11
With this configuration, I'm able to ping the guest from a foreign IP and to ping the foreign IP even using DNS.
The problem is the following: I want to connect the guest systems to each other. This works great, if the local IPs are used (192.168.7.100, 192.168.7.101, ...). But if I want to use a DNS system which reports the global IP address (18.104.22.168), connection is not possible. If I use "ping example.org" on Guest with local IP "192.168.7.100", I get the correct IP "22.214.171.124" but then I get a timeout. If I ping "192.168.7.101" (the local IP) however, everything works great. All foreign IPs (e.g. google.com) can be pinged without problems.
So my question is: how is it possible to connect the Guest systems to each other without using the local IPs but the IPs given by DNS?
Thanks a lot!