Page 1 of 1

DHCP server on Guest

Posted: 16. Jan 2009, 18:56
by dominiquearpin
Hi,

I would like to have a DHCP server on my guest OS to serve all other guest OS and the PC in the same physical switch. That's possible? All the guest and the host are under Fedora 9.

I use static IP for all my Guest OS and I have no problem (web, ftp, etc), but I will like to install a DHCP server on a Guest OS not the HOST.

I use virtualBox 2.1.0

thank you

Posted: 18. Jan 2009, 20:04
by Sasquatch
I don't know, and you don't specify, what connectivity your other Guests will have, and how the rest of your network is build, but if you use HIF, then the Host and all the other guests attached to HIF will get a DHCP address if the VM that offers DHCP is running. Note that any other machine on the network will get an address from the VM too, unless you have them on static.

If you only want the Host and other guests to obtain a DHCP, while the Host has another NIC for internet use, you need to create a virtual TAP interface so it doesn't mess with your current setup of the Host.

Posted: 19. Jan 2009, 17:44
by dominiquearpin
Ok,

I had found a solution, but is incomplete. Now, I can use a DHCP server on a host and give IP to all the VM.

I add a tap device for each VM and I modify the vm, example:

tunctl -t tap1 -u vmuser
ip link set up dev tap1
brctl addif br0 tap1

VboxManage modifyvm VM1 -hostifdev1 tap1

And I just need to add eth0 to the bridge:
ip addr add 192.168.0.1/24 dev eth0
brctl addif br0 eth0

So, everything works perfectly

thanks