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

Re: wireless lan config



On Wed, 15 Aug 2001, NeilFred Picciotto wrote:

> this is a pretty slick way of doing it.  but does anyone have a convenient
> way of switching between multiple locations (with different network
> passwords, and so on)?  

Well, I wrote myself a little shell script that I keep in
/usr/local/bin/netswitch:

#!/bin/sh
PATH=/sbin:$PATH
cp /etc/resolv.conf.$1 /etc/resolv.conf
cp /etc/network/interfaces.$1 /etc/network/interfaces
/sbin/ifdown eth0
/sbin/ifup eth0

Then I can just keep resolv.conf and interface files with the name of the
locations tagged on the end, i.e.:

/etc/resolv.conf.home
/etc/resolv.conf.work

/etc/network/interfaces.home
/etc/network/interfaces.lynden

...and when I go to a new location, I just pop up terminal and type

netswitch home

or 

netswitch work

or

netswitch foo

as required (I'm currently managing four different configurations this
way). I'm sure this could be polished up quite a bit, but it gets the job
done...

-raf



Reply to: