Re: Roaming Ethernet/Wireless Configureation Options
Paul and Martin,
I've spent the last few hours looking into some of the features and
options of some programs. It seems that ifplugd,
wpasupplicant, guessnet, and resolvconf are the way to go.
I've done a little write up, and hopefully someone could help me
correct/expand it. This is what I've done so far, and it's
"kinda" working.
Packages installed:
ifplugd (0.26-2.1)
wpasupplicant (0.4.6-0.2)
resolvconf (1.34)
guessnet (0.38-1)
First I put all 3 of these packages on my machine. A quick
explanation of each of their roles follows, with links to pages for
more information. (I can't stand doing things just because you're
told. Hopefully these links will help you understand them a bit
more.)
----------------------------------------
ifplugd - "ifplugd is a Linux daemon which will automatically
configure your ethernet device when a cable is plugged in and
automatically unconfigure it if the cable is pulled. This is useful on
laptops with onboard network adapters, since it will only configure
the interface when a cable is really connected."
http://www.stud.uni-hamburg.de/users/lennart/projects/ifplugd/
wpasupplicant - "wpa_supplicant is designed to be a "daemon" program that runs in the
background and acts as the backend component controlling the wireless
connection. wpa_supplicant supports separate frontend programs and a
text-based frontend (wpa_cli) and a GUI (wpa_gui) are included with
wpa_supplicant."
http://hostap.epitest.fi/wpa_supplicant/
resolvconf - "
Resolvconf is a framework for keeping track of the system's
information about currently available nameservers. It sets
itself up as the intermediary between programs that supply
nameserver information and programs that use nameserver
information."
http://packages.debian.org/testing/net/resolvconf
guessnet - "guessnet is a program that tries to guess the current network
location using fake ARP requests."
http://www.students.cs.unibo.it/~zinie/it/guessnet/index.html
----------------------------------------
wpasupplicant setup
- - - - - - - - - - - - - -
First things first, I enabled wpasupplicant and set up the options. Edit /etc/default/wpasupplicant (shortened a bit):
#start config
ENABLED=1
OPTIONS="-D ipw -i eth1 -c /etc/wpa_supplicant.conf -w"
# 'ipw' driver works for ipw2100 and ipw2200 cards
# wireless interface is eth1
#end config
Now we need to set up some networks for the WPA keys to associate with. Edit /etc/wpa_supplicant.conf
#start config
network={
ssid="my_home_ssid"
key_mgmt=NONE
auth_alg=SHARED
wep_key0=0123456789ABCDEF
wep_tx_keyidx=0
priority=5
}
network={
ssid="my_work_ssid"
key_mgmt=NONE
auth_alg=SHARED
wep_key0=0123456789ABCDEF
wep_tx_keyidx=0
priority=5
}
#end config
NOTE: Put this in to associate with any open SSID:
network={
ssid=""
key_mgmt=NONE
priority=0
}
ifplugd
- - - - -
Double check /etc/default/ifplugd (though it should be set up from the package install).
interfaces & guessnet config
- - - - - - - - - - - - - - - - - - - -
Add two simple networks for ifplugd. Edit /etc/network/interfaces file.
#start config
auto lo
iface lo inet loopback
#mapping stuff for wireless card
mapping eth1
script /usr/sbin/guessnet-ifupdown
map eth1-home eth1-school
map timeout: 3
map verbose: true
map debug: true
map default: eth1-unknown
#home config
iface eth1-home inet dhcp
test wireless essid my_home_ssid
#school config
iface eth1-school inet dhcp
test wireless essid my_work_ssid
#unknown - try's dhcp
iface eth1-unknown inet dhcp
#end config
----------------------------------------
Well, this has left me in an almost usable state.
What it does: Upon boot, I am associated with the correct access
point. Doing a "iwconfig" the AP and WEP keys are set correctly. It
does set correctly on both access points as well.
What it doesn't do: It doesn't notice that it's been associated
(maybe?) and it does not acquire an IP address. I need to kick in
dhclient in there or something maybe? This part isn't quite
figured out yet.
Well, with this long post, hopefully someone will get some use out of
it. It does work "kinda", like I said. It's a million times
better than before. I simply login, su up to root, and issue a
'ifup eth1' and its connected and works until reboot. However,
its not quite 100% automated yet.
Any questions about this process or additions anyone would like to add would be much appreciated.
Doug Miller
Reply to: