Re: dhclient - won't reuse IP after reboots
I don't think there is anything you can do on your end, although I could
dhcp-client writes to /var/lib/dhcp/dhcp.leases information about your
current lease (including ip addresses, renewal time and so on). My
understanding of this was that when the machine boots, it looks at the
most recent lease and quiries the dchp server to see if the ip address
is available. If it is, you get it. If not, you get a new address that
goes into the leases file to be your "preferred" ip address. So once you
lose you old address, you might not regain it for a while.
It clearly depends on the number of machines asking for ip addresses on
your subnet. In my building, I can almost always get the same address,
but in the next building, the addresses change frequently.
I maintain a number of dual booting, public linux boxes in another
building. One thing I did that helped me, was that I wrote a short
script which I put in /etc/init.d/ (with a link in /etc/rc2.d) so that
when the machine booted, it wrote the contents of ifconfig to /tmp, and
then mailed it to me. That way, I always knew when it was online and
what the current ip address was. I also wrote a corresponding script to
tell me when it went down.
D. Nathan Cookson wrote:
I am running Woody on a machine Dual Booting with Windows 98. I recently
switched from Red Hat 7.3 to Woody, running with a mix of
stable/testing/unstable packages, but noticed this behavior PRIOR to
updating any packages to testing or unstable in an attempt to resolve the
I am going to use x.x.x.x to refer to the IP addresses, and only be
specifying the last octet for sure. I use this box to ssh to from work, to
give me a second point to test from for networking issues. I work in
Network Operations for an ISP. My wife is a full-time student and we live
on campus. We have internet connectivity via Ethernet ports in our
apartment. The IP addresses are served via DHCP, and uses our MAC address
for authentication. We have lived there for nearly 2 years, and during
that time, the IP addresses assigned to our machines has changed only once,
about a year ago. When they changed the configuration about a year ago, the
then investigated those who were configured for static IPs to make sure they
weren't running high badnwidth servers, so I would prefer not to conifgure
it for a static. For the last 15 months, my machine has recieved an IP of
x.x.x.147 under Win98 and Red Hat 7.2/7.3. My wife's machine has recieved
x.x.x.169, until I installed Woody.
When I installed Woody, I got the x.x.x.147 address on the first boot, on
subsequent reboots, I have never recieved that IP address again. The first
time it happened, I figured campus changed the configuration on their end,
like they did last year. I do not live the machine on 24/7 because power is
NOT cheap, and every little bit around the house helps. However, I often
do not power the machine on before leaving work and have to call and have my
wife power it on, and run ifconfig for me to get the current IP address.
This adds a small but building annoyance factor. I then thought, well,
campus has gained a little wisdom, and is going to be rotating IPs to help
discourage bandwidth hogging web/ftp servers. Until, I happened to use my
wife's computer and noticed her IP had not changed. I then went to my
computer, rebooted to Windows, and had the x.x.x.147 address again.
The crux of it is, am i missing a hidden option in dhclient-script or
dhclient.conf that sets it up decline any IP addresses it has already had?
How do I configure it to NOT decline addresses that are offered to it?