Setup 1 NAT per NIC

Discussions related to using VirtualBox on Windows hosts.
Post Reply
VBnoob
Posts: 3
Joined: 17. Jul 2009, 21:03
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: XP

Setup 1 NAT per NIC

Post by VBnoob »

I have a machine with multiple nics. Each nic is on a different subnet (Corporate LAN & Sandbox vlan for example). Is it possible to setup Multiple NAT and Bridge scopes in VB, so that I can have one VM nated/bridged to one nic, and a different VM connected to the other NIC?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Setup 1 NAT per NIC

Post by Sasquatch »

No, that's currently not possible. If you have multiple NICs with each their own gateway, accessing an IP address from either network will work with NAT. If you really want to have separate configs, you have to use Bridged. This can be a problem though, as managed switches can block their ports when they detect more than one MAC address on it (they have to be configured for it, which is default on campus like environments).

There is something else you can try, which involves something similar to NAT, only you create a NAT yourself. Creating multiple Host-Only adapters, adding each to it's own VM and setting some routes on the Host using routing software can do the job. It involves some knowledge about networking and routing, but if you're into computers, then Google (or your favourite search engine) can help you on your way to accomplish this.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Setup 1 NAT per NIC

Post by Sasquatch »

vbox4me2 wrote:Yes.
Care to explain this? I've never seen an option to limit VB NAT to a defined network. Only to change the IP range it sets for the NAT network inside the VM.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: Setup 1 NAT per NIC

Post by vbox4me2 »

You gave the answer yourself already, there are several ways including a natted vm. VBox nat can be duplicated by changing its scope per vm, how far this stretches I don't know, only experimented with 2 nats and that works fine (vb 2.08).
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Setup 1 NAT per NIC

Post by Sasquatch »

vbox4me2 wrote:You gave the answer yourself already, there are several ways including a natted vm. VBox nat can be duplicated by changing its scope per vm, how far this stretches I don't know, only experimented with 2 nats and that works fine (vb 2.08).
It only changes the network address inside the VM, it doesn't change the networks you can access on the outside. If you use the default NAT, you can still access a 192.168.0.0/24 subnet and 172.16.0.0/16 one. Changing the NAT range to 192.168.1.0/24, you can still access both subnets. The TS is asking if it's possible to split the subnet access with NAT. AFAIK, that can't be done with the VB NAT implementation.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply