dhclient dhcpctl usage

Boaz Ben-David boaz.bd at wellsense-tech.com
Tue Jan 10 07:01:40 UTC 2012


On 01/09/2012 10:36 PM, Ed Ravin wrote:
> On Mon, Jan 09, 2012 at 03:21:37PM -0500, Ed Ravin wrote:
>> On Mon, Jan 09, 2012 at 09:26:14PM +0200, Boaz Ben-David wrote:
>>> By control I mean requesting the dhcp client to renew a lease,
>>> release a lease, knowing that a lease was successfully squires
>>> etc...
>> You can more or less do that with omcmd, omshell, or another dhcpctl-based
>> program, which will talk to the ISC DHCP server.
>>
>> But the dhcpctl API is only for talking to the server, not the client.  If
>> you want to mess with the ISC dhclient program, you can try killing the
>> running dhclient, edit its lease database (dhclient.leases) to change
>> what you want, and restart it.
> Actually, you probably want to use "dhclient -r" on the client machine
> to release the lease, and just restart dhclient to renew the lease.
> Or hack your own dhclient code to do what you want.  Just changing state
> on the client side may get the client to do something but not necessarily
> change the state on the server.
>
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users

The motivation is so I can control the dhcp client daemon from another 
process written in C++.

For example, udhcpc (busybox's dhcp client) can be controlled using two 
signals (one for renew and one for release).

My problem is that I can order udhcpc to renew, for example, but I don't 
get any feedback as for the outcome of the

request. I want to be able to signal the client to renew and get a 
result (success, fail, timeout...) in my C++ program.


If anyone has a better way of doing this I will be more than happy to hear.


Thanks,

Boaz.




More information about the dhcp-users mailing list