Opened 7 years ago
Last modified 6 years ago
#16683 new enhancement
DHCP Reservations
Reported by: | hydrian | Owned by: | |
---|---|---|---|
Component: | other | Version: | VirtualBox 5.1.20 |
Keywords: | dhcp network | Cc: | |
Guest type: | other | Host type: | other |
Description
Being able to define a DHCP IP reservation based on MAC address for Internal and NAT Networks. This is extremely useful having a reliable IP of r guest before the OS is installed. Think automated builds.
Running an external DHCP server is not always easy or even possible. Try to to install a DHCPd server on a Windows or Mac desktop....
Change History (2)
comment:1 by , 7 years ago
comment:2 by , 6 years ago
I know it is very old ticket but in libvirt I can do something like below when defining a network, is it possible to do something like this in virtualbox?
<network> <name>test1</name> <uuid>79d21e39-30b0-4367-a96d-842cf7887ad7</uuid> <forward mode='nat'> <nat> <port start='1024' end='65535'/> </nat> </forward> <bridge name='tt0' stp='on' delay='0'/> <mac address='52:54:00:58:5f:44'/> <domain name='tt.testing' localOnly='yes'/> <dns> <srv service='etcd-server-ssl' protocol='tcp' domain='test1.tt.testing' target='test1-etcd-0.tt.testing' port='2380' weight='10'/> <host ip='192.168.126.10'> <hostname>test1-api</hostname> </host> <host ip='192.168.126.11'> <hostname>test1-api</hostname> <hostname>test1-etcd-0</hostname> </host> </dns> <ip family='ipv4' address='192.168.126.1' prefix='24'> <dhcp> <host mac='82:7d:df:54:21:62' name='test1-master-0' ip='192.168.126.11'/> <host mac='16:91:31:2c:c2:a4' name='test1-bootstrap' ip='192.168.126.10'/> <host mac='e2:14:06:fa:79:79' name='test1-worker-0-n8dtz' ip='192.168.126.51'/> </dhcp> </ip> </network>
That would be indeed useful. Maybe for now a workaround like manually changing the corresponding leases file will be sufficient for you? Have a look at the VirtualBox home directory (on Windows it's /Users/USER/.VirtualBox, on Linux either $HOME/.config/VirtualBox or $HOME/.VirtualBox) and look for NETNAME.leases where NETNAME is the name of the network. This file contains active leases. The DHCP server reads this file on startup (NOT at runtime!.