[TriLUG] Wireless Roaming in Ubuntu

David McDowell turnpike420 at gmail.com
Tue Jul 19 09:53:44 EDT 2005


The bottom half of this link, in the "notes" section, may also give
you an alternative way to script your changes between networks.  It
doesn't help the automatic switching though.

http://www.turnpike420.net/linux/ipw2200.txt

David McD


On 7/18/05, Timothy A. Chagnon <tchagnon at futeki.net> wrote:
> Like Jeff said, setting the essid to any will work for auto-connecting
> to an open AP.  The command to find out which APs are around is:
> sudo iwlist [interface] scanning
> 
> I've got the scenario where I want my laptop to auto-pick an ESSID and
> WEP key based on where I am (work or home).  The /etc/network/interfaces
> file has the mapping mechanism that allows you to use a script to pick
> your options.  It's described (cryptically, imho) in the interfaces(5)
> man page.  Basically you write a script that takes an interface name as
> the first argument and prints out another interface to jump to.  My
> mapping-script just looks for my home or work AP's ESSID in the iwlist
> scanning output then prints the interface name to jump to, very simple.
> Here's my generalized config for those who are interested (eth1 is my
> wireless card):
> 
> # /etc/network/interfaces
> auto lo eth1
> iface lo inet loopback
> 
> mapping eth1
>    # script prints out an interface below to jump to
>    script /usr/local/bin/mapping-script
> 
> iface eth1-work inet dhcp
>    wireless-essid WorkID
>    wireless-key abcdef0123
> 
> iface eth1-home inet dhcp
>    wireless-essid HomeID
>    wireless-key 0123456789
> 
> iface eth1-auto inet dhcp
>    wireless-essid any
> # EOF
> 
> #!/bin/bash
> # /usr/local/bin/mapping-script
> 
> iface="$1"
> if [ -z "$iface" ] ; then
>    echo "Usage: $0 IFACE"
>    exit 1
> fi
> 
> iwlist eth1 scanning|grep ESSID:\"HomeID\" >/dev/null 2>&1
> if [ $? -eq 0 ]; then
>    echo $iface-home
>    exit
> fi
> 
> iwlist eth1 scanning|grep ESSID:\"WorkID\" >/dev/null 2>&1
> if [ $? -eq 0 ]; then
>    echo $iface-work
>    exit
> fi
> 
> # if we're not at home or work look for an open AP
> iwlist eth1 scanning|grep key:off >/dev/null 2>&1
> if [ $? -eq 0 ]; then
>    echo $iface-auto
>    exit
> fi
> #EOF
> 
> Good luck,
> Tim
> 
> On Mon, 2005-07-18 at 19:27 +0000, Randall Barlow wrote:
> > How do I get Ubuntu to figure out which wireless AP I am in range of and
> > automatically connect to that one without having to go into the
> > properties window and manually change the profile?  I seem to recall
> > some kind of list of AP's that iwconfig looks through upon booting, but
> > I can't seem to find info about it right now.  Thanks!
> 
> 
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ  : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc
>



More information about the TriLUG mailing list