DCHP host entry with 2 IP's ?

Simon Hobson dhcp1 at thehobsons.co.uk
Fri Aug 5 22:33:11 UTC 2011


Paul Reilly wrote:

>>Yes, for remote subnets. For local subnets, it uses its own network 
>>address for the comparison.

>Yes, that makes sense for remote subnets. But for local subnets does 
>it compare it to it's own IP address?
>What if there's more than 1 local subnet?

It uses the address(es) assigned to the interface on which the packet 
was received. If there is only one address on that interface then 
that uniquely identifies a subnet. If there are multiple IP 
addresses, then there must be a corresponding shared-network 
statement to identify the subnets on that interface.
As long as you correctly describe your network, then it all "just works".

>One other question which is bugging me, is if the lease time is set 
>high, say 1 day,  and a laptop user in subnet 10  walks to another 
>building and plugs in to subnet 20,  their machine still has the 1 
>day lease from subnet 10. From what I've seen in the DHCP logs, when 
>the laptop starts up again, it doesn't do a DHCPDISCOVER but a 
>DHCPREQUEST for it's subnet 10 address.  At the moment the DHCP 
>sends back a DCHPACK saying yeah, that IP is fine, but it's clearly 
>not, as it won't work in that subnet. What is the expected behaviour?

If the server is ACKing an address for the wrong subnet then your 
setup is wrong. You didn't put the 10 and 20 subnets inside a 
shared-network declaration did you ?

What should happen is that the client is permitted to attempt to use 
a non-expired lease. It will broadcast a DHCP-Request for the leased 
address, and if it's still valid then the server will DHCP-Ack it. If 
the client has moved, and the address is not valid for that subnet, 
then the server will DHCP-Nack it, the client abandons the lease and 
start afresh with a DHCP-Discover and so on.

Many clients take a shortcut, and if they have an unexpired lease AND 
the default router is the same (same MAC address) then they may 
assume they are still on the same physical network and continue using 
the address. Typically they'll still broadcast a DHCP-Request - but 
teh check for "am I still on the same network" means they can 
continue working if the DHCP server is temporarily down.


-- 
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