Ubuntu – Is it possible to setup a DHCP Server for localhost only

dhcpnetworkingUbuntuvmware-workstation

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.

Best Answer

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.