Page 1 of 1
NAT'd VMs can't talk to other NAT'd VMs
Posted: 9. Nov 2009, 19:55
by mubix
What it truly boils down to is I need a bunch of VMs to be able to talk to one another, and to be able to talk to the 'internet'. Is the only way to do this to set every VM up with two interfaces? One NAT and one 'internal' ?
Re: NAT'd VMs can't talk to other NAT'd VMs
Posted: 9. Nov 2009, 20:53
by vbox4me2
Or Bridge mode. or use 1 VM with a Bridge and internet networking setup with ICS, the other VM's connect to the internal network.
Re: NAT'd VMs can't talk to other NAT'd VMs
Posted: 9. Nov 2009, 20:56
by mubix
I can't use bridged in this scenario, and I was trying to not have to set up a separate VM as a NATing device, but thanks for the response.
Re: NAT'd VMs can't talk to other NAT'd VMs
Posted: 10. Nov 2009, 00:10
by Sasquatch
Either NAT + Internal, NAT + Host-Only or Bridged are your options.
Re: NAT'd VMs can't talk to other NAT'd VMs
Posted: 10. Nov 2009, 19:07
by mubix
Sasquatch wrote:Either NAT + Internal, NAT + Host-Only or Bridged are your options.
Thanks!, I've looked on the main page, is there a feature request section/link that I'm just not seeing?
Re: NAT'd VMs can't talk to other NAT'd VMs
Posted: 10. Nov 2009, 19:25
by Perryg
Re: NAT'd VMs can't talk to other NAT'd VMs
Posted: 10. Nov 2009, 23:43
by Sasquatch
There is one other option you can use, and that is Internet Connection Sharing on the Host using the Host-Only adapter. You have to disable the VB DHCP server and set the Host-Only adapter to 192.168.0.1 netmask 255.255.255.0. The Guests will use that IP as gateway and the Host's DNS as their own DNS. The Guests should be able to obtain an IP address automatically. This is when you're on Windows Host.
For a Linux Host, you need IPTables, some rules (just one line, another is for actual forwarding through the interfaces, modify as needed) for it and your own IP configuration that you want to use.
Code: Select all
# Enable internet sharing for VMs
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
This done on the Host. The interface eth0 is the one you have internet on. I have this in /etc/rc.local.