El día Thursday, September 20, 2007 a las 08:43:57AM +0200, Heiko Wundram
(Beenic) escribió:
Am Donnerstag 20 September 2007 04:47:03 schrieb C Thala:
That OS from the NorthWestern US seems to keep a list of WAPs and will
detect whenever you are in the vicinity of one and use the available
one. How can I get FreeBSD to do the same?
Try setting up a wpa_supplicant configuration (and putting WPA DHCP in
rc.conf); that does the proximity-switching for you (and does so for me,
happily).
I don't really know whether wpa_supplicant works with non-security-enabled
(i.e. non-WEP and non-WPA) wireless networks, but I guess there's a switch to
tell it to do so.
I have some 10 diffrent AP in my file /etc/wpa_supplicant.conf
because I'm traveling often to diffrent locations of our company,
WPA-PSK and WEP, for example:
# Coimbra
#
network={
ssid=x
key_mgmt=WPA-PSK
psk=x
}
# Westeregeln
#
network={
ssid=x
scan_ssid=0
key_mgmt=NONE
wep_tx_keyidx=0
wep_key0=x
}
in /etc/rc.conf I only have
ifconfig_iwi0=WPA
but in addition I'm using the daemon devd(8) to set the IP stuff
of iwi0 accordingly to the network I'm associating; you need two
files for this:
/usr/local/etc/devd/iwi.conf
notify 1 {
match system IFNET;
match subsystem iwi0;
match typeLINK_UP;
action /usr/local/etc/devd/iwi.sh $subsystem $type;
};
notify 1 {
match system IFNET;
match subsystem iwi0;
match typeLINK_DOWN;
action /usr/local/etc/devd/iwi.sh $subsystem $type;
};
and the work is done in the sheel script /usr/local/etc/devd/iwi.sh
like for example:
#!/bin/sh
#
echo `date`: $0 $* /tmp/devd.out
case $2 in
'LINK_DOWN')
exit 0 ;
;;
esac
ap=`/sbin/ifconfig iwi0 list sta | awk '{print $1;}' | fgrep -v ADDR`
case ${ap} in
'00:04:e2:a1:76:0b')
printf ap [%s] seems to be the Oberhaching office\n ${ap}
/tmp/devd.out ;
#
ifconfig bge0 222.222.222.2 netmask 255.255.255.0
ifconfig bge0 down
dhclient iwi0
#
# drop and reload the firewall rules
ipf -D
ipf -E
ipmon -Ds
ipf -Fa -f /etc/ipf.rules.sisis
ipnat -CF -f /etc/ipnat.rules.sisis
;;
...
*)
printf ap [%s] not known in %s\n ${ap} $0 /tmp/devd.out ;
;;
esac
exit 0
this means when you get associated to an AP and LINK comes UP, the
devd(8) wakes up and runs the sheel script doing all the right work;
works really nice;
matthias
--
Matthias Apitz
Manager Technical Support - OCLC PICA GmbH
Gruenwalder Weg 28g - 82041 Oberhaching - Germany
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e [EMAIL PROTECTED] - w http://www.oclcpica.org/ http://www.UnixArea.de/
b http://gurucubano.blogspot.com/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]