[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dhclient & switching networks



Nic Ferrier wrote:

> Derek Broughton <news@pointerstop.ca> writes:
> 
>> 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
>> port 67
>> Sep  8 08:44:18 othello dhclient: DHCPACK from 192.168.1.1
> 
> This is the report from the connection at your work place?

It is, though the only legitimate DHCP servers are on 142.2.*.*

>> 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?
> 
> Get a normal address and then:
> 
>    ifconfig eth0:1 192.168.1.107 netmask 255.255.255.0
>    ping 192.168.1.1

Oh, well, that seemed to be the hard way once I had deleted my lease file so
that it got the correct address, and got an address of 142.2.70.34, and I
realized arping did what I really wanted:

ARPING 192.168.1.1 from 142.2.70.34 eth0
Unicast reply from 192.168.1.1 [00:06:25:08:2A:A0]  1.773ms

So now I have a MAC address to wave at the network folks upstairs, and I
know there's a real server.

>> 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 file).
> 
> Make sure you have dhcp3-client, 

I said that :-)

> I had lots of funny problems till I switched to that version.

So did I, which is why I'm really not enamored of trying another one.

The thing is, I can prevent dhclient from even seeing 192.168.1.1 - but then
it won't work at home.  I could change the router address at home, so it
wouldn't conflict, but I'd still run the risk of coming across another
rogue dhcp server on another address.  In any case, for a first order of
business, I think I'll put the current lease in my dhclient.conf file and
see if it helps.  
-- 
derek



Reply to: