How Ubuntu Read DHCP Options


In a small project, I need to make Ubuntu get the ‘FTP Root’ option’s value from the Windows 2003 DHCP server. For some reasons that I don’t know, Ubuntu does not include ‘FTP Root’ (code 162) in the standard dhcp-option.

So I have to modify the ‘/etc/dhcp/dhclient.conf ’ to make it happen. Add the following entries in red.

option ftp-root code 162 = string;

request subnet-mask, broadcast-address, time-offset, routers,
    domain-name, domain-name-servers, domain-search, host-name,
    netbios-name-servers, netbios-scope, interface-mtu,
    rfc3442-classless-static-routes, ntp-servers, ftp-root,
    dhcp6.domain-search, dhcp6.fqdn,
    dhcp6.name-servers, dhcp6.sntp-servers;

Run ‘dhclient –r eth0’ or reboot the machine. Then do cat $(ls -t /var/lib/dhcp/* | head -1)

The FTP Root value should be listed there now.

lease {
  interface “eth0”;
  fixed-address 10.3.5.83;
  option subnet-mask 255.255.255.0;
  option routers 10.3.5.254;
  option dhcp-lease-time 691200;
    option dhcp-message-type 5;
  option domain-name-servers 10.3.5.21,10.3.5.22;
  option dhcp-server-identifier 10.3.5.1;
  option ftp-root \\ftproot;
  option dhcp-renewal-time 345600;
  option dhcp-rebinding-time 604800;
  renew 6 2012/04/07 15:35:58;
  rebind 3 2012/04/11 06:34:25;
  expire 4 2012/04/12 06:34:25;
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s