linux: how to access DHCP options from client

As you may know, you can configure any DHCP server to send many options to the clients; for example to setup dns domains, http proxy (WPAD) and so on. If you need to access these options from a linux client, you must configure the client to ASK the server for the new options, by editing /etc/dhcp/dhclient.conf, and add an entry like: option WPAD code 252 = string; also request WPAD; done that, when you’ll ask for a dhcp, the dhclient process will invoke your hook scripts with two new environment variables, old_WPAD and new_WPAD, with the values before and after the renewal....

November 6, 2017 · Andrea Manzini