Page 1 of 1
Virtual LAN DHCP
Posted: 5. Nov 2011, 13:08
by HairyFool
I have Win7 x64 Host on main lan with internet access via ADSL router, the router is DHCP for the external LAN
I am installing Win Svr 2008 R2 x64 as a guest. This OS has to run its own DHCP in order to maintain services needed for the test I am trying to run. I tried setting the VirtualBox Network adapter in bridged mode but the guest OS still sees the external DHCP and will not run its own.
How do I set up the Virtualbox Network so that the guest can see the host as only the default gateway of its own LAN to access the internet but run its own DHCP?
Re: Virtual LAN DHCP
Posted: 5. Nov 2011, 15:05
by Perryg
Not a good idea.
Running multiple dhcp servers in the same lan will cause issues. You should isolate the windows guest to its own lan (internal).
Re: Virtual LAN DHCP
Posted: 5. Nov 2011, 19:29
by HairyFool
That is precisely the problem. Because the guest can see the DHCP of the router its own DHCP server will not start. If however I run the guest O/S on an Internal network it has no access to the external LAN via the Virtualbox network interface of the host. The DHCP service will then start on the guest O/S but the server loses contact with the internet.
I have as a test turned off the firewall for the host and enabled IP routing on the host. Turning off the firewall allows the guest to ping the network interface but I am still not getting the traffic through even to the external interface of the host.
I have seen this issue on the web elswhere and the solution provide was to run another VM with two NICs, one on the internal network and the other bridged to the host thereby acting as a router. Seems a bit odd that I cannot route traffic from the internal network to the external without actually joining the guest to the external LAN.
NAT does not seem to be the answer as then multiple VMs cant see each other as I understand.
Re: Virtual LAN DHCP
Posted: 5. Nov 2011, 19:35
by Perryg
Seems a bit odd that I cannot route traffic from the internal network to the external without actually joining the guest to the external LAN.
Not odd at all. It was the way it was designed so you could isolate the test "domain" from the local lan.
You can set it up the way you want but the domain becomes multi-homed and unless you are really good with Windows domain management you will have issues.
Re: Virtual LAN DHCP
Posted: 6. Nov 2011, 01:22
by BillG
This really has very little to do with VirtualBox. Is this the first time you have had a network with more than one segment or more than one subnet?
If you want to run your own DHCP server it must be in its own segment and its own IP subnet. DHCP works using LAN broadcasts. If you have two DHCP servers in the same segment, both will see the DHCP requests and both will make an offer.
Routing through the host is not a good idea (for several reasons). The simplest way to do what you want is to use NAT, and the Windows client OS does not provide that (and ICS is very limited). You would need third party NAT software. Without NAT you need to add static routing to your Internet router (to get traffic from the Internet to your private LAN). All of this is standard networking and applies equally to physical machines on physical networks.
The best solution is to run a vm as a NAT router between an internal network (where you private LAN vms are) and the physical LAN (through a bridged NIC in the router vm). You can run RRAS in a Windows server as a router or a standalone Linux router like pfsense.