I have a quick question. I have a bunch of VM's (VMWare Workstation) running on a Ubuntu server and have found that VMWare NAT (DHCP) service is unreliable and slow. I have to do use NAT instead of Bridging because I don't have enough static IP's for all the VMs.
Is it possible to setup the Linux Host (Ubuntu) to be a DHCP server but only for the local VM's?
The server has 2 NIC's so if I set eth0 to be a static IP, which connects to the outside work, and eth1 to listen for DHCP. Now, I am thinking if I don't want DHCP to broadcast I would just not connect a cable to eth1 and setup the VM's to connect to eth1 for the DHCP addresses. That way DHCP would not broadcast through my network but be listening on that interface.
Would that setup work?
EDIT
I have to use NAT or DHCP for the Guest VM's because the servers are in a data-center which does not offer DHCP and we don't have enough static IP's.
Thanks.
I'm sure you could use iptables to simply block any incoming DHCP requests from other machines but another option is to set up your DHCP server with just enough scope to supply your VMs, which should have reservations set for each. That way there will be no other addresses which can be handed out, even if the server did happen to receive a request.
If you need just simple DHCP server, I would suggest using dnsmasq ( http://thekelleys.org.uk/dnsmasq/doc.html ). Its a powerful DNS forwarder but comes with integrated DHCP server. I am not sure if you can disable the DNS part completely but should it be problem you can configure it on a different port.
Configuring DHCP is one config option ( --dhcp-range ), and its the same with more advanced features.
In my experience using Virtualbox 4.x under a NAT situation, Virtualbox creates a virtual network inside the Host with its own IP range and Gateway (gateway being the host with a static ip) which the VMs live within. All external access is through the NAT'ing gateway on a virtual network adapter separate from any physical adapters and cables.
Therefore it is possible under Virtualbox, knowing the internal NAT network details, to disable the Virtualbox DHCP server and provide your own from within the virtual network.
DHCP will not traverse outside of a gateway unless it is specifically routed, for example through a VPN tunnel.
I cannot comment specifically on VMWare but I assume it works in a similar fashion.
Should this be successful you will need to ensure the VM providing DHCP gives the same network details as the host otherwise you will loose access to them via the network. However with my little experience of VMWare, you should have a console session available in order to configure the DHCP machine should you loose network access.