dhcpcd-discuss

Re: Custom dhcp options

Shahid Mahmood

Wed Apr 20 14:42:34 2016

Worked as documented. I can request and see custom option being sent in the
discover message and subsequent offer from the server including the same.

Thanks!
-shahid

On Tue, Apr 19, 2016 at 9:18 AM, Roy Marples <roy@xxxxxxxxxxxx> wrote:

> Hi
>
> On 18/04/2016 22:14, Shahid Mahmood wrote:
> > Is is possible to extract custom options from the lease that are not
> > part of standard dhcp options? (ie they are not in dhcp.h)
> >
> > We have some custom options configured in our DHCP server that the
> > client needs to retrieve. So far, the only solution at hand is to patch
> > dhcp.c (and related files).
>
> You can define custom options in dhcpcd.conf, which will override any
> dhcpcd defined option.
>
> For example I recently added an option to extract the fairly complex
> iSNS option from RFC4174
>
> # iSNS, RFC4174
> define 83       embed                   isns
> embed           byte                    reserved1
> embed           bitflags=00000SAE       functions
> embed           byte                    reserved2
> embed           bitflags=00fFsSCE       dd
> embed           byte                    reserved3
> embed           bitflags=0000DMHE       admin
> embed           uint16                  reserved4
> embed           byte                    reserved5
> embed           bitflags=0TXPAMSE       server_security
> embed           array ipaddress         servers
>
> You should read dhcpcd.conf(5) for more details on this :)
>
> Once defined, you can then request the option like any other:
> option isns
>
> Then you'll find new variables available to dhcpcd-run-hooks(8)
> new_isns_functions, new_isns_dd, new_isns_admin,
> new_isns_server_security and new_isns_servers.
>
> Roy
>

References:
Custom dhcp optionsShahid Mahmood
Re: Custom dhcp optionsRoy Marples
Archive administrator: postmaster@marples.name