NAT connection is independent on a per guest basis.

This is for discussing general topics about how to use VirtualBox.
Post Reply
gilesc
Posts: 16
Joined: 19. May 2011, 12:42
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Linux, Windows

NAT connection is independent on a per guest basis.

Post by gilesc »

Hi,

I am running VirtualBox 4.0.8 on Windows 7 x64.

I have multiple guests and would like them all to be able to access the Network connection on my host computer and would also like them to be able to see each other on the NAT subnet.

It appears however, that each host gets the same IP address 10.0.2.15 from the Host system's DHCP server and none of them can see each other.

Is there an easy way to achieve this?

As a workaround I'm planning to have a dual-homed virtual firewall with either a bridged or NAT connection and another interface card with a Host-Only connection. All other guests will have the Host-Only connection and use this virtual firewall as their gateway.

Is there an easier way that doesn't involve the virtual firewall?

Thanks

Giles
Leak
Posts: 242
Joined: 31. Mar 2009, 13:00
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Debian Testing, Windows XP, Windows Server 2003/2008 R2

Re: NAT connection is independent on a per guest basis.

Post by Leak »

Errr... that's exactly the use case the "Internal network" mode for the emulated NICs is for - just add another NIC to the VMs then use the same network name for all the guest VMs that should be able to see each other.

np: Gescom - Slow Acid (ISS:SA)
gilesc
Posts: 16
Joined: 19. May 2011, 12:42
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Linux, Windows

Re: NAT connection is independent on a per guest basis.

Post by gilesc »

Yes, but am I right in thinking that if I use Host Only then none of my hosts have access to the network connection that my host system has?

With VMware products I recall the NAT interface provided the host system as the defualt gateway, allowing the virtual systems to see each other and the network the host was connected to.

With VirtualBox it appears that the NAT interface gives each host NAT access to the network the host has, but doesn't allow different virtual hosts to see each other.

I can't see an easy way of achieving this on VirtualBox. Hence my question.
Leak
Posts: 242
Joined: 31. Mar 2009, 13:00
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Debian Testing, Windows XP, Windows Server 2003/2008 R2

Re: NAT connection is independent on a per guest basis.

Post by Leak »

gilesc wrote:With VirtualBox it appears that the NAT interface gives each host NAT access to the network the host has, but doesn't allow different virtual hosts to see each other.
True.

But it also gives you up to 4 (or 8, using the command line) network cards per VM - so you can use one for NAT to access the internet, and another one for an internal network (which is a different option than "Host-only") to connect the VMs to each other. Or you could, of course, run a single VM with NAT and internal network and use it as a router for the other VMs with just internal networking.

np: Pantha Du Prince - Welt Am Draht (Black Noise)
gilesc
Posts: 16
Joined: 19. May 2011, 12:42
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Linux, Windows

Re: NAT connection is independent on a per guest basis.

Post by gilesc »

Leak wrote:Or you could, of course, run a single VM with NAT and internal network and use it as a router for the other VMs with just internal networking.
Which is what I've gone ahead and done. I'm using Smoothwall, and it appears to work quite well, don't know if anyone else is doing something similar, and whether they are using any particular pre-built Vbox as a router / firewall?

I'd be interested to hear what anyone else is using for this.

I didn't think of giving every VBox two interfaces, one NAT and the other host-only, but I guess that would probably work as well - It wouldn't however, represent much of a real-world environment, which is what I'm trying to represent in my labs.
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: NAT connection is independent on a per guest basis.

Post by BillG »

I run my vms on an internal network and run one vm as a firewall/router. The router has on NIC (public) bridged to the phyisical network the other (private) as the default gateway for the internal network (just as you would run a physical network behind a firewall/router).

Whether you use NAT or not is your decision (just as it is with a physical network). NAT is easiest because you do not need to modify the routing on the physical LAN.
Bill
ChipMcK
Volunteer
Posts: 1095
Joined: 20. May 2009, 02:17
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, OSX
Location: U S of A

Re: NAT connection is independent on a per guest basis.

Post by ChipMcK »

Post Reply