How to send DHCPrelease?

Ted Lemon Ted_Lemon at isc.org
Wed Aug 25 14:15:59 UTC 1999


> Ok, sounds good. Is this what the object management API is intended to do, or is the main
> purpose for it something else?

It's intended both as a control mechanism and as a way of querying and
modifying the internal databases of the DHCP client and server.

> Actually, I really want to do the renewal from scratch, like a
> reboot/reinit where the client tries to get the addresses from
> living leases, and if that fails it should send discover instead.
> That is more like the state_init(), isn't it?

You should call state_init if the current lease has expired, and
state_bound if it has not.   If you call state_init when you have a
valid lease, any existing network connections will be abruptly
terminated.

> To make it work, I'll have to do it on both sides... 

Right.   Well, from the client side, you just write "send
subnet-selection-option xx.yy.zz.kk;" in the /etc/dhclient.conf file
for a particular interface or pseudo declaration.   On the server
side, you just have to hack locate_network to prefer the subnet
selection option to the giaddr or the interface on which the packet
arrived.

> Why would I need to call state_init? The release for the old address
> is sent *after* that the client has asked for and received a new
> address on another subnet.

That's not what the protocol says you're supposed to do.   You're
supposed to release the lease *before* you try to get a new one.
If you release it afterwards, the release message is going to come
from the wrong IP address, and the server should reject it.

			       _MelloN_


More information about the dhcp-hackers mailing list