passing values to client

Simon Hobson dhcp1 at thehobsons.co.uk
Sun Jan 11 08:57:54 UTC 2009


Carl Karsten wrote:
>Currently the clonezilla CD will bring up sshd and set a password if 
>you enter 2 boot parameters.
>
>I am trying to figure out how to add some code that will get those 2 
>parameters from the dhcp client.   So what is the normal way for an 
>app to get parameters that were received by dhcpcd or dhclient?

I don't know the details as I've never done anything special in the 
client, but there are three steps involved.

First, you will need to configure the server to supply the parameters 
- in this case, you'll probably have to define "site local" options.

Then you'll need to configure the client to ask for them. This is in 
the client config file where (IIRC) you can specify a custom option 
list to be requested.


Lastly, I assume the client will store what it receives somewhere 
before calling the client script. If you look at the client, there is 
a script which does all the processing - so you will probably want to 
modify that to stash the values where they are easily accessible to 
your application.

In Debian the files are in /etc/dhcp3, and I see that there are two 
directories dhclient-[enter|exit]-hooks.d which contain scripts that 
are run by the client on a state change.


-- 
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.



More information about the dhcp-users mailing list