help with dhcp custom options

Robert Schweikert rschweikert at novell.com
Fri May 27 18:30:21 UTC 2011


I suppose this is rather frequently discussed topic as I found many 
threads with this topic, yet I was still not able to figure out an 
answer to my question. Thus, help is much appreciated.

I need to identify a DHCP server for a specific purpose and then set up 
clients to look for this specific DHCP server while refusing lease 
offers from other DHCP server that my be on the network. My idea was to 
do this via a custom option.

I have the following dhcpd.conf file:

option rfc3442-classless-static-routes code 121 = array of unsigned 
integer 8;
option domain-name "mydomain";
max-lease-time 7200;
# Custom option to identify this DHCP server as the cloud DHCP server
# Define the new option
option special-purpose code 239 = ip-address;
# Set the value
option special-purpose 192.168.1.2;
# Set the address range to be handed out.
subnet 192.168.1.0 netmask 255.255.255.0 {
     range 192.168.1.5 192.168.1.10;
     default-lease-time 86400000;
     max-lease-time 1728000000000;
}

And on the client side I have dhclient.conf

option rfc3442-classless-static-routes_raw code 121 = array of unsigned 
integer 8;

# Request several well known/usefull dhcp options.
request subnet-mask, broadcast-address, routers,
	rfc3442-classless-static-routes_raw,
	interface-mtu, host-name, domain-name,
	domain-name-servers, nis-domain, nis-servers,
	nds-context, nds-servers, nds-tree-name,
	netbios-name-servers, netbios-dd-server,
	netbios-node-type, netbios-scope, ntp-servers;

# We request above options, require only the IP configuration:
require subnet-mask;
# All another options (DNS, NTP, NIS, ...) are applied using
# netconfig(8) modules.

# To enforce the availability of the dns server list, set to:
#require subnet-mask, domain-name-servers;

timeout 60;
retry 60;
reboot 10;
select-timeout 5;
initial-interval 2;

option special-purpose code 239 = ip-address;
require special-purpose;


With the dhcp server running on machine A (not startup messages or 
errors) and rge dhclient running on machine B, I get complaints that the 
server is not offering the "special-purpose" option. Thus the lease is 
not being accepted.

How do I get the server to send the option?

Or am I going about this the wrong way and I should do this differently?

Thanks,
Robert

-- 
Robert Schweikert                           MAY THE SOURCE BE WITH YOU
SUSE-IBM Software Integration Center                   LINUX
Tech Lead
rschweikert at novell.com
rschweikert at ca.ibm.com
781-464-8147



More information about the dhcp-users mailing list