I have a scenario where I have two FreeBSD machines. I setup one to be a DHCP server so it can lease IP address. I have provided IP ranges, default DNS , host name , and all other settings in my dhcpd.conf file,

option domain-name "josh";
option domain-name-servers;

option subnet-mask;
default-lease-time 600;
max-lease-time 7200;

subnet netmask {
  option routers;

and the second one to be a client. When I am running the FreeBSD client virtual machine, it has a static IP address of, but I want it to lease the IP address from the FreeBSD DHCP server that I setup.

I have done this in rc.d file,


But how does it know the IP address of the DHCP server to lease from?

Both the machines are setup in VMWare environment, and are on the same network.

2 Answers 2


Client doesn't need to know IP address of the DHCP server. Client will send initial packet to all hosts within its subnet using broadcast address
For further reading you may refer to official documentation of DHCP protocol https://www.rfc-editor.org/rfc/rfc2132
To restart dhcp client on particular network interface (em0in your case), you may run /etc/rc.d/dhclient restart em0


To answer your specific question 'But how does it know whats the IP address of the DHCP server to lease from ? Can someone please help me with that ?', the answer is whichever DHCP server gets a packet to your machine first.

If you're running in vmware, it would also be running a DHCP server – you'll need to work out how configure it to not provide an address for this vm.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .