Ubuntu DHCP Client Custom Parameters

From KHicks
Jump to: navigation, search

The DHCP client configuration can probably be found at /etc/dhcp/dhclient.conf. Here is an example file with options 66 and 160:

#option <name> code <int> = <type>
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
option opt160 code 160 = ip-address;
option opt66 code 66 = text;

send host-name = gethostname();
#send dhcp-lease-time 3600;
#prepend domain-name-servers;
request subnet-mask, broadcast-address, time-offset, routers,
    domain-name, domain-name-servers, domain-search, host-name,
    dhcp6.name-servers, dhcp6.domain-search,
    netbios-name-servers, netbios-scope, interface-mtu,
    rfc3442-classless-static-routes, ntp-servers,
    dhcp6.fqdn, dhcp6.sntp-servers, opt160, opt66;
#require subnet-mask, domain-name-servers;
timeout 300;

Note the option, er, options at the top. These are included in the request array below them. When the DHCP request is sent, the client will request the values of those options from the server and interpret them as the specified type.