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

Re: static vs. DHCP - and wireless vs. wired



"Derek Broughton" <derek_broughton@hotmail.com> writes:
> From: "Bill Moseley" <moseley@hank.org>
>
>> Anyone have tips for setting up a laptop for static vs. DHCP?
>>
>> I've always run static IPs on my home lan.  But I'll be using DHCP at
>> hotels and conferences.  I don't have a DHCP server to test with, so I'm
>> looking for example configs.
>
> Not really.  guessnet, laptop-net, intuitively, whereami, and no doubt
> numerous other packages, usedynamic methods to detect which network you're
> on.  As long as there's one other machine on your network that it can find
> by MAC address they will choose the configuration for you.  If you know one
> machine on your home net then you can default anything else to assume DHCP.

I use guessnet to pretty much exactly this end.  My
/etc/network/interfaces looks sort of like

mapping eth0
        script /usr/bin/guessnet
        map 18.101.2.57 00:60:8C:F4:B8:20 18.101.2.49 eth0-home

iface eth0-home inet static
        address 18.101.2.57
        netmask 255.255.255.240
        broadcast 18.101.2.63
        gateway 18.101.2.49
        up ifconfig eth0 mtu 1480
        up /etc/init.d/zhm start
        down /etc/init.d/zhm stop

iface eth0-none inet dhcp

...except more complicated, and generated by an m4 script with some
help from Perl.  :-)  But this is the basic infrastructure you'd need
to come up with one particular setting at home (for known values of
"at home" where you can come up with an IP address/MAC address pair
for a known machine) and use DHCP elsewhere.

Caveats: I don't think guessnet is in potato.  Starting and stopping
network-dependent services needs to be done on a per-mapping basis
(see calls to /etc/init.d/zhm above, for example).  There is no 'auto
eth0' line, this gets started out of the pcmcia scripts directly.
This also doesn't deal with higher-level configurations you might want
to tweak (say, setting your home Kerberos realm based on what IP
address you come up on), or with multiple interfaces.

-- 
David Maze         dmaze@debian.org      http://people.debian.org/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
	-- Abra Mitchell


-- 
To UNSUBSCRIBE, email to debian-laptop-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: