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

Re: Laptop used in multiple network contexts?

Finally, someone asks on a technical list a question that I actually
know something about :-)

John Whitley wrote:

> 1) What (if any) is the preferred mechansism for preventing Linux from
>    stalling all over the place on DNS timeouts when an otherwise
>    network connected laptop becomes laptop-at-large?

If your laptop is not connected to a network, what exactly is it that
you are doing that would make any sense in a network-less context that
causes DNS timeouts?

> 2) Is there a mechanism in Linux for easily switching between different
>    network situations? 

Yes. It is called DHCP. You can check out dhcpd(8) (the server daemon)
and dhcpcd(8) (the client daemon). I have found a few problems using
this that could be solved with scripts. For instance, despite claims to
the contrary, dhcpcd does *not* seamlessly do updates. I have found that
it is necessary to kill and restart it in order to get things assigned
properly. I also had to  symlink /etc/resolv.conf to
/etc/dhcpc/resolv.conf in order to get updates performed by dhcpcd to
interact properly with those performed by Xisp. I also had to modify
some of the scripts that Xisp uses (in particular, it is necessary to
delete any existing default route assigned by DHCP or else your PPP
connection comes up without the default route using it, rendering it
useless; then you restart dhcpcd when the PPP line is brought down to
get your original network context restored).

In short, this is a very complicated problem. Complicated enough that
Windoze does not seamlessly handle it either. The biggest problems on
the Windoze side have to do with Micro$haft Networking rather than
network context, something that the Linux automounter solves quite
nicely but Windoze doesn't make it possible to automatically switch
between different NT domains, or between using an NT domain and using a
domain-less network such as my home network, without restarting the
entire OS). Linux can be made to do so, thanks to the flexibility it
affords that Windoze lacks. I've thought about trying to write up what
I've done to make this work (I got some help from the Linux Laptops
folks doing it), but I haven't had time to do it yet. But I can
definitely say that there is light at the end of the tunnel. I use my
Debian laptop on various nets, and with various ISP's, and the worst I
have to do is manually run a script I wrote to restart dhcpcd to get the
new network context when I plug in. I have even configured the
automounter so that it will mount filesystems from whatever known server
is available in each network context. It also dual boots Windoze 98 (I
need to be able to play games on the road :-) You can do a lot with
these machines. Next: modify the scripts used by cardmgr to have them
automatically run the DHCP restart script whenever I plug in my PCMCIA
Ethernet card.


Reply to: