Requesting Specific Address From DHCP

Hi:
Suppose if I have a DHCP server with a pool of address from 192.168.0.1-192.168.0.100

And for interface em0 I want to request the address of 192.168.0.50, is this possible with FreeBSD?

I know I can do:
Code:
interface "em0" {
   send host-name "myhostname";
   send dhcp-requested-address 192.168.0.50;
}

in dhclient.conf on other OS, is there a similar command like this for FreeBSD?

Or do I simply just do:
Code:
ifconfig em0 192.168.0.50
?

Thanks
Bill
 
I suspect the first will work but haven't tried it.

As long as an address isn't already in use, the second will work. DHCP servers ping an address before assigning it, so it will reassign that address.
 
You could also reserve that IP address on the DHCP server. You can couple the machine's MAC address to a specific IP address so that machine will always receive the same IP address.
 
SirDice said:
You could also reserve that IP address on the DHCP server. You can couple the machine's MAC address to a specific IP address so that machine will always receive the same IP address.

This is the right way of doing. I don't see the point in requesting a preferred IP to a dhcp server, since DHCP is made to let clients don't bother with IPs....
 
There are use cases, like a broadband client without any control over the ISP attempting to keep the dynamic IP address they've been using.
 
wblock@ said:
There are use cases, like a broadband client without any control over the ISP attempting to keep the dynamic IP address they've been using.

Correct. However you cannot rely on it.
 
Back
Top