From owner-freebsd-questions@FreeBSD.ORG Thu Sep 20 08:25:18 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2352516A421 for ; Thu, 20 Sep 2007 08:25:18 +0000 (UTC) (envelope-from M.Apitz@oclcpica.org) Received: from mail.pica.nl (mail.pica.nl [192.87.44.30]) by mx1.freebsd.org (Postfix) with ESMTP id 585DF13C46A for ; Thu, 20 Sep 2007 08:25:17 +0000 (UTC) (envelope-from M.Apitz@oclcpica.org) Received: from rebelion.Sisis.de ([193.31.10.34]) by mail.pica.nl with Microsoft SMTPSVC(6.0.3790.3959); Thu, 20 Sep 2007 10:13:27 +0200 Received: (from guru@localhost) by rebelion.Sisis.de (8.13.8/8.13.8/Submit) id l8K8CZEk002016; Thu, 20 Sep 2007 10:12:35 +0200 (CEST) (envelope-from m.apitz@oclcpica.org) X-Authentication-Warning: rebelion.Sisis.de: guru set sender to m.apitz@oclcpica.org using -f Date: Thu, 20 Sep 2007 10:12:35 +0200 From: Matthias Apitz To: "Heiko Wundram (Beenic)" Message-ID: <20070920081235.GA1797@rebelion.Sisis.de> References: <77647f500709191947k2fc9098aq12f068a91cf6941@mail.gmail.com> <200709200843.58410.wundram@beenic.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <200709200843.58410.wundram@beenic.net> User-Agent: Mutt/1.4.2.2i X-Operating-System: FreeBSD 6.2-RELEASE (i386) X-OriginalArrivalTime: 20 Sep 2007 08:13:27.0587 (UTC) FILETIME=[1F69BF30:01C7FB5E] Cc: C Thala , freebsd-questions@freebsd.org Subject: Re: switching between WAPs X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthias Apitz List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2007 08:25:18 -0000 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="xxxxxxxxxxxxx" key_mgmt=WPA-PSK psk="xxxxxxxxxxxxx" } # Westeregeln # network={ ssid="xxxxxxxxxxxxx" scan_ssid=0 key_mgmt=NONE wep_tx_keyidx=0 wep_key0=xxxxxxxxxxxxx } 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 "type" "LINK_UP"; action "/usr/local/etc/devd/iwi.sh $subsystem $type"; }; notify 1 { match "system" "IFNET"; match "subsystem" "iwi0"; match "type" "LINK_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 - w http://www.oclcpica.org/ http://www.UnixArea.de/ b http://gurucubano.blogspot.com/