dhclient & switching networks
When I connect to my network at home through the lan (wired) connection of a
Linksys WRT54G router, I get an address in the 192.168.1.* range, assigned
by the DHCP server in the router. Next morning when I connect at work,
dhclient immediately gives me the same IP.
Sep 8 08:44:18 othello dhclient: DHCPDISCOVER on eth0 to 255.255.255.255
port 67 interval 4
Sep 8 08:44:18 othello dhclient: DHCPOFFER from 192.168.1.1
Sep 8 08:44:18 othello dhclient: DHCPREQUEST on eth0 to 255.255.255.255
Sep 8 08:44:18 othello dhclient: DHCPACK from 192.168.1.1
What I should be getting is:
Sep 8 08:46:12 othello dhclient: DHCPDISCOVER on eth0 to 255.255.255.255
port 67 interval 3
Sep 8 08:46:12 othello dhclient: DHCPOFFER from 22.214.171.124
Sep 8 08:46:12 othello dhclient: DHCPREQUEST on eth0 to 255.255.255.255
Sep 8 08:46:12 othello dhclient: DHCPACK from 126.96.36.199
It would seem somebody's got a rogue DHCP server on our network, but what
confuses me is that if I simply delete the /var/run/dhclient.eth0.leases
file (which _only_ contains the address from the home DHCP server, nothing
from previous connections to this subnet), the next time I run dhclient it
finds the right DHCP server and assigns the right address.
Another confusing thing is that this only happens if my address was assigned
by the router. When I connect at home through a machine with Win98SE
Internet Connection Sharing, and get an address in the 192.168.0.* range,
no problem - but I am guessing this is somehow connected to the fact that
the rogue server on this net isn't handing out 192.168.0.* addresses.
My questions are:
Am I right that there is really a server on 192.168.1.1 (I can't ping it)?
How could I find out?
Or is it simply reusing the lease without really calling the DHCP server -
if so, why would it _say_ it sent the DHCPDISCOVER? (this just doesn't
seem at all likely to me).
How can I prevent getting assigned the 192.168.1.* address at work (I'm
currently using dhcp3-client, ifupdown, ifplugd & whereami). The really
simple solution is to delete the lease file before booting, but it seems so
inelegant! (Not to mention that it loses the whole point of having a lease
One final question, why wasn't there a lease from 142.2.*.* (there's at
least two different DHCP servers there) in my lease file already, from
yesterday? They give lease times of one month. Am I just using the wrong
DHCP client (so many choices, so little time :-))