NIC dedicated to guests, inaccessible to host?

Discussions related to using VirtualBox on Linux hosts.
Post Reply
JS
Posts: 4
Joined: 22. May 2012, 16:54

NIC dedicated to guests, inaccessible to host?

Post by JS »

Hi,

I want to create an "out of band" network for VM management, separate from the lan on which the VMs and their users sit.

Is the following possible:

Out of band network is: 10.0.0.0
VM LAN is: 10.0.1.0
Use two NICs in the host (Ubuntu 11.04 server).
Set the IP address on one to 10.0.0.254, being the NIC that the host OS uses for all it's network activity (out-of-band)
Set the IP address on the other NIC to 10.0.1.254, and bind the VMs to this NIC in bridged mode so that they can all have 10.0.1.*** IP addresses.
A firewall will restrict which LAN workstations can access the out-of-band network.

?

I have set this up and the VMs work fine, but when a workstation on 10.0.1.*** attempts to route through the firewall to the 10.0.0.254 address, connectivity fails because the host of course wont reply back through the 10.0.0.* gateway, instead it uses it's 10.0.1.254 NIC. So as it stands I have to expose VM management tools to the LAN, which I'd rather not do.

Thanks for any hints on getting this, or any better approach, to work. I've tried to search the forums for advice but only found similar requests for Windows hosts, not Linux.

Jon
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: NIC dedicated to guests, inaccessible to host?

Post by mpack »

What will playing with IP addresses do? If you want a dedicated NIC for the guests, use bridged network mode. Let the router assign IP addresses.
JS
Posts: 4
Joined: 22. May 2012, 16:54

Re: NIC dedicated to guests, inaccessible to host?

Post by JS »

The VMs do get their IPs from DHCP. So should I just dispense with the IP on the host LAN NIC?

I think I tried that first but couldn't get the VMs to bind. Let me check and confirm.

Thanks for replying.
JS
Posts: 4
Joined: 22. May 2012, 16:54

Re: NIC dedicated to guests, inaccessible to host?

Post by JS »

**SOLVED ** - thanks: I'd tried it with "ifconfig eth1 down" where eth1 is the LAN NIC, and that hadn't worked. But having the NIC up, with no address config in /etc/network/interfaces (just the one line: auto eth1) worked, with my VMs all using the NIC successfully.

Thanks! I know this was a Linux question, not a Virtualbox question, but thought I'd get more clarity here than elsewhere.
JS
Posts: 4
Joined: 22. May 2012, 16:54

Re: NIC dedicated to guests, inaccessible to host?

Post by JS »

Ah, for benefit of other readers - that didn't work following a host reboot, so I had to add a dummy address to /etc/network/interfaces for eth1. I used:


iface eth1 inet static
address 1.2.3.4
netmask 255.255.255.0
network 1.2.3.0
broadcast 1.2.3.255

That way the NIC comes up ok and the VMs bind to it, but it isn't operational on the LAN which has addresses 10.0.1.***
Post Reply