On Wed, Jan 22, 2003 at 02:39:02PM +0000, David Robertson wrote:
> Every time I move my laptop from one location to the other, I
> have to set up the network connection from scratch.

I had this problem with my laptop (running MDK 8.1, now 9.0).  It gets
used at the following locations:

* at work on LAN
* at home connected to an ISP with a modem (and a private two-host LAN)_
* at home connected to my employer's modem pool
* at a friend's house on a LAN connected to DSL

I eventually solved the problem by having separate versions of the
following files for each location, with a "location" suffix appended
to each filename:

  /etc/postfix/main.cf
  /etc/sysconfig/network
  /etc/sysconfig/network-scripts/ifcfg-eth0
  /etc/resolv.conf

Then I wrote a shell script that, given a location name argument,
creates symbolic links for the above files that point to the
location-specific versions of the files.

The script brings down eth0 before the tweaking the symlinks ("ifdown
eth0") and brings it back up again afterwards ("ifup eth0").  It also
restarts postfix after tweaking main.cf ("postfix reload"); otherwise
postfix will refuse to send mail if it's moved from one network to
another.

MacOS has a feature called "location manager" that does this sort
of thing with a GUI.  I think it would be very useful on Linux, too.

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to