On Mon, Apr 12, 2010 at 01:17:07PM +0100, Mick wrote

> You probably want to look at wpa_supplicant (in particular man
> wpa_gui), or any other network manager type of application would do
> (wicd, network manager, wifi-radar) which allows you to enable/disable
> access points for automatic connection to them.
> 
> Alternatively, a less practical approach would be to set up
> 
> config_wlan0=( "null" )
> 
> in your /etc/conf.d/net.wlan0, which will not allow your wireless card
> to obtain any address.  Or, you can play with dhcpcd options like so:
> 
> dhcp_eth0="release nogateway nosendhost" which means that it will not
> bind to any wireless router as a gateway.

  Thanks. that keeps things sane.  Now let's start with simple stuff
first, manually connecting to an open access point at the public
library.  Listed below are files /etc/conf.d/net, ~/bin/wi_open, and
/etc/wpa_supplicant.conf.open.  Assuming that I have /etc/sudoers
properly set up, is ~/bin/wi_open the correct incantation?  It copies
the appropriate config to /etc/wpa_supplicant.conf and then starts and
connects wifi.  I plan to have multiple config files, to cover different
situations.

/etc/conf.d/net
===============
config_eth0="192.168.123.249 broadcast 192.168.123.255 netmask
255.255.255.248 mtu 1452"
routes_eth0=(
"default via 192.168.123.254 metric 2"
"192.168.123.248/29 via 192.168.123.254 metric 0"
)
modules=( "wpa_supplicant" )
config_wlan0=( "null" )
wpa_supplicant_wlan0="-Dwext"
wpa_timeout_wlan0=15


~/bin/wi_open
==============
#!/bin/bash
sudo /bin/cp /etc/wpa_supplicant.conf.open /etc/wpa_supplicant.conf
sudo /sbin/modprobe ath5k
sudo /etc/init.d/net.wlan0 restart
sudo /sbin/ifconfig wlan0 up
sudo /sbin/iwconfig wlan0 essid any channel auto
sudo /usr/sbin/wpa_supplicant -iwlan0
sudo /sbin/dhcpcd -C resolv.conf -C mtu wlan0


/etc/wpa_supplicant.conf.open
=============================
# Connect to an open AP
network={
  ssid="public library"
  key_mgmt=NONE
  priority=9
}

network={
  key_mgmt=NONE
  priority=-9
}


-- 
Walter Dnes <waltd...@waltdnes.org>

Reply via email to