client request preferred IP address

Simon Hobson dhcp1 at thehobsons.co.uk
Thu Jul 19 15:43:22 UTC 2007


Jeff Weber wrote:

>/etc/init.d/network stop
>
>verified my preferred IP address was currently unallocated
>
>edited my preferred IP address into my old leases
>(/var/lib/dhcp/dhclient-eth1.leases)
>
>/etc/init.d/network start
>
>checked new IP address, which unfortunately never changed from the IP address
>I started with.
>
>Bummer.  The DHCP server is running MSWindows.  I'm probably at the mercy of
>the server, which is remembering my MAC address.

It will also be remembering your current lease - have you tried 
explicitly releasing the lease before downing the interface ?

>BTW, here's why I'm undertaking this exercise.  Our corporate network is
>nearly 95% MWWindows.  We have no DNS.  My group doesn't have much influence
>with the DHCP server administration.  The DHCP IP addresses tend to be very
>sticky, especially on the Windows boxes.  Some Windows users say their IP
>hasn't moved in years.

That is a function of the Windows clients, they REALLY like to stick 
to their addresses (and that includes using a previously manually 
configured one) - which is fun on a network with a broken DHCP server 
that does send DHCP-NAKs ! I'm fairly certain that the server will 
let you have an address you ask for as long as it's free AND you 
don't already have another active lease (which is what is probably 
tripping you up).

>We have a few Linux boxes, and often SSH between the Linux boxes. 
>I work with the pool of Linux boxes, which see the IP addresses move every few
>months.  The reasons are not fully understood.   When this happens, it's a
>nuisance.  It usually means having to re-memorize the new IP addresses, and
>hunt down and modify every record of previous IP addresses.
>
>It would be a great feature if I could "re-claim" my previous IP address
>immediately after I lose it.

Better still would be to work the system and get an address that 
doesn't change ! IIRC the MS server generally starts allocating 
leases starting with the lowest addresses first. See if you can find 
out what the highest address is and try requesting the highest free 
address - as long as you don't have an active lease then you should 
stand a good chance of getting it AND more importantly, a good chance 
that it will not be re-assigned while your machine is switched off. 
After that, you need some way of forcing the client to always request 
that lease which is, I guess, back to your original request !

As a thought, what if you write a shutdown script which modifies the 
stored lease to have an infinite end-time ? That way, when you start 
up your client will 'think' it's got a current lease and will request 
it's last address - and I imagine 'correct' the end time when it 
renews during bootup.


Ultimately, your problem is that the MS DHCP server is NOT standards 
compliant - as if that is likely to be any surprise.


More information about the dhcp-users mailing list