From owner-freebsd-wireless@FreeBSD.ORG Sat Oct 26 16:51:31 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9291A92 for ; Sat, 26 Oct 2013 16:51:31 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qc0-x233.google.com (mail-qc0-x233.google.com [IPv6:2607:f8b0:400d:c01::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 519232785 for ; Sat, 26 Oct 2013 16:51:31 +0000 (UTC) Received: by mail-qc0-f179.google.com with SMTP id k18so2900325qcv.24 for ; Sat, 26 Oct 2013 09:51:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=tWKmaAkS3DJ+3jsShKrb+RS+VTNgWPUGJQPHdjj1YLY=; b=w0bt0cE/k8qMQjhqyLZC0JXXvVTA+BstRGK/C07m8fNRRbiNCKEo6S1SUN+DBi+Jzx L7YtPR03MEk/pv36xY+0yGIML/gN2ehuZbrx9PtQ51ry319vkZpXA4RDrvxvABcA4yYo TxpxAKvrrLV/56oXgnisWq/zEkggQqSCNMZ71xT8/oW9LhIID6V61pMnhWTC5kkAPn99 kAYZkpeH8gdHBsh/fp27iwfF0R8zbBA5XdVWJllHxH3DsmuKUn5dbrFtcTbNy5exB7Vl n7FRRO+euVq7Up332alpMUeb1sfR8W0llUi78SE0Bo+fEeak/TBMNKlnZh++ia/ujJTC ak0A== MIME-Version: 1.0 X-Received: by 10.224.63.199 with SMTP id c7mr19026391qai.74.1382806290262; Sat, 26 Oct 2013 09:51:30 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Sat, 26 Oct 2013 09:51:30 -0700 (PDT) In-Reply-To: References: Date: Sat, 26 Oct 2013 09:51:30 -0700 X-Google-Sender-Auth: yiyOxqCyrSNbDGaqMSHLVYC-2Cc Message-ID: Subject: Re: implementing multiple BSSID addresses for different VAPs, or 'why was the flag called bssid again?' From: Adrian Chadd To: =?ISO-8859-1?Q?Ulrich_Sp=F6rlein?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "freebsd-wireless@freebsd.org" X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Oct 2013 16:51:31 -0000 Hi, It doesn't surprise me that the devd and rc.conf scripts seem to be clashing. I'd very much like to see this fixed. Would someone please take a crack at it? Thanks! -a On 26 October 2013 07:32, Ulrich Sp=F6rlein wrote: > Well, the following in rc.conf > > wlans_ath0=3D"wlan0 wlan2" > create_args_wlan0=3D"bssid wlanmode hostap country DE authmode wpa ssid > COYOTE" > ifconfig_wlan0=3D"ssid COYOTE mode 11g pureg up" > create_args_wlan2=3D"bssid wlanmode hostap country DE authmode wpa ssid > COYOTE_GUEST" > ifconfig_wlan2=3D"ssid COYOTE_GUEST mode 11g pureg up" > > Does not quite work, I'm left with: > > (from dmesg) > Setting hostname: coyote.spoerlein.net. > bridge0: Ethernet address: 02:ac:6e:56:db:00 > Created clone interfaces: bridge0. > wlan0: Ethernet address: 68:a3:c4:51:44:99 > wlan2: Ethernet address: 6e:a3:c4:51:44:99 > ifconfig: SIOCS80211: Device busy > ath0: stuck beacon; resetting (bmiss count 4) > > (not that there's no echo for creating wlan devices, that should maybe > be added?) > > Anyway, I thus get this: > > ath0: flags=3D8943 > metric 0 mtu 2290 > ether 68:a3:c4:51:44:99 > nd6 options=3D21 > media: IEEE 802.11 Wireless Ethernet autoselect mode 11g > status: running > wlan0: flags=3D8d43 > metric 0 mtu 1500 > ether 68:a3:c4:51:44:99 > inet6 fe80::6aa3:c4ff:fe51:4499%wlan0 prefixlen 64 tentative > scopeid 0xa > nd6 options=3D29 > media: IEEE 802.11 Wireless Ethernet autoselect mode 11g > status: no carrier > ssid COYOTE channel 7 (2442 MHz 11g) > regdomain ETSI country DE indoor ecm authmode WPA2/802.11i > privacy MIXED deftxkey 2 AES-CCM 2:128-bit txpower 30 scanvalid 6= 0 > pureg protmode CTS wme burst dtimperiod 1 -dfs > wlan2: flags=3D8943 > metric 0 mtu 1500 > ether 6e:a3:c4:51:44:99 > inet6 fe80::6ca3:c4ff:fe51:4499%wlan2 prefixlen 64 tentative > scopeid 0xb > nd6 options=3D29 > media: IEEE 802.11 Wireless Ethernet autoselect mode 11g > status: running > ssid COYOTE_GUEST channel 7 (2442 MHz 11g) bssid 6e:a3:c4:51:44:9= 9 > regdomain ETSI country DE indoor ecm authmode 802.1x privacy MIXE= D > deftxkey UNDEF txpower 30 scanvalid 60 pureg protmode CTS wme bur= st > dtimperiod 1 -dfs > > root@coyote:~# ifconfig ath0 > ath0: flags=3D8802 metric 0 mtu 2290 > ether 68:a3:c4:51:44:99 > nd6 options=3D21 > media: IEEE 802.11 Wireless Ethernet autoselect > (autoselect ) > status: no carrier > root@coyote:~# ifconfig wlan0 create wlandev ath0 bssid wlanmode > hostap country DE authmode wpa ssid COYOTE > root@coyote:~# ifconfig wlan0 > wlan0: flags=3D8943 > metric 0 mtu 1500 > ether 6a:a3:c4:51:44:99 > inet6 fe80::68a3:c4ff:fe51:4499%wlan0 prefixlen 64 tentative > scopeid 0xa > nd6 options=3D29 > media: IEEE 802.11 Wireless Ethernet autoselect mode 11g > status: running > ssid COYOTE channel 13 (2472 MHz 11g) bssid 6a:a3:c4:51:44:99 > regdomain ETSI country DE indoor ecm authmode 802.1x privacy MIXE= D > deftxkey UNDEF txpower 30 scanvalid 60 pureg protmode CTS wme bur= st > dtimperiod 1 -dfs > root@coyote:~# ifconfig wlan2 create wlandev ath0 bssid wlanmode > hostap country DE authmode wpa ssid COYOTE_GUEST > ifconfig: SIOCS80211: Device busy > Exit 1 > root@coyote:~# ifconfig wlan2 > wlan2: flags=3D8943 > metric 0 mtu 1500 > ether 6e:a3:c4:51:44:99 > inet6 fe80::6ca3:c4ff:fe51:4499%wlan2 prefixlen 64 tentative > scopeid 0xb > nd6 options=3D29 > media: IEEE 802.11 Wireless Ethernet autoselect mode 11g > status: running > ssid COYOTE_GUEST channel 13 (2472 MHz 11g) bssid 6e:a3:c4:51:44:= 99 > regdomain ETSI country DE indoor ecm authmode 802.1x privacy MIXE= D > deftxkey UNDEF txpower 30 scanvalid 60 pureg protmode CTS wme bur= st > dtimperiod 1 -dfs > root@coyote:~# ifconfig wlan0; ifconfig wlan2 > wlan0: flags=3D8943 > metric 0 mtu 1500 > ether 6a:a3:c4:51:44:99 > inet6 fe80::68a3:c4ff:fe51:4499%wlan0 prefixlen 64 tentative > scopeid 0xa > nd6 options=3D29 > media: IEEE 802.11 Wireless Ethernet autoselect mode 11g > status: running > ssid COYOTE channel 13 (2472 MHz 11g) bssid 6a:a3:c4:51:44:99 > regdomain ETSI country DE indoor ecm authmode 802.1x privacy MIXE= D > deftxkey UNDEF txpower 30 scanvalid 60 pureg protmode CTS wme bur= st > dtimperiod 1 -dfs > wlan2: flags=3D8943 > metric 0 mtu 1500 > ether 6e:a3:c4:51:44:99 > inet6 fe80::6ca3:c4ff:fe51:4499%wlan2 prefixlen 64 tentative > scopeid 0xb > nd6 options=3D29 > media: IEEE 802.11 Wireless Ethernet autoselect mode 11g > status: running > ssid COYOTE_GUEST channel 13 (2472 MHz 11g) bssid 6e:a3:c4:51:44:= 99 > regdomain ETSI country DE indoor ecm authmode 802.1x privacy MIXE= D > deftxkey UNDEF txpower 30 scanvalid 60 pureg protmode CTS wme bur= st > dtimperiod 1 -dfs > > > Then I also had to bounce the hostapd on wlan0 and start the one on > wlan2 and it looks very promising currently. Is it possible that there > is a timing issue involved and doing it manually works better than > when the startup scripts run through this? > > > I've now got this working version that seems to be solid and comes up > during boot w/o manual intervention. > > /etc/rc.conf: > wlans_ath0=3D"wlan0 wlan2" > create_args_wlan0=3D"bssid wlanmode hostap country DE authmode wpa ssid > COYOTE" > create_args_wlan2=3D"bssid wlanmode hostap country DE authmode wpa ssid > COYOTE_GUEST" > (no ifconfig_wlanX settings, I'm using a bridge for these, no hostapd!) > > /etc/rc.local: > #!/bin/sh > /etc/rc.d/hostapd start wlan0 > sleep 2 > /etc/rc.d/hostapd start wlan2 > > and I get: > > root@coyote:~# ifconfig wlan0; ifconfig wlan2 > wlan0: flags=3D8943 > metric 0 mtu 1500 > ether 68:a3:c4:51:44:99 > nd6 options=3D29 > media: IEEE 802.11 Wireless Ethernet autoselect mode 11g > status: running > ssid COYOTE channel 13 (2472 MHz 11g) bssid 68:a3:c4:51:44:99 > regdomain ETSI country DE indoor ecm authmode WPA2/802.11i > privacy MIXED deftxkey 2 AES-CCM 2:128-bit txpower 30 scanvalid 6= 0 > protmode CTS wme burst dtimperiod 1 -dfs > wlan2: flags=3D8943 > metric 0 mtu 1500 > ether 6e:a3:c4:51:44:99 > nd6 options=3D29 > media: IEEE 802.11 Wireless Ethernet autoselect mode 11g > status: running > ssid COYOTE_GUEST channel 13 (2472 MHz 11g) bssid 6e:a3:c4:51:44:= 99 > regdomain ETSI country DE indoor ecm authmode WPA2/802.11i > privacy MIXED deftxkey 2 AES-CCM 2:128-bit txpower 30 scanvalid 6= 0 > protmode CTS wme burst dtimperiod 1 -dfs > root@coyote:~# pgrep -fl hostapd > 3071 /usr/sbin/hostapd -P /var/run/hostapd-wlan2.pid -B > /etc/hostapd-wlan2.conf > 3061 /usr/sbin/hostapd -P /var/run/hostapd-wlan0.pid -B > /etc/hostapd-wlan0.conf > > Now I need to un-bridge the wlan2, put in a firewalled guest network > and tweak pf accordingly. Or maybe I'll use a pf-based filtering > bridge. And I still need an USB fob for that 5GHz AP. > > Thanks! > Uli > > > 2013/10/21 Adrian Chadd : > > So, I finally (!) figured out how this address cloning crap works. > > > > In if_ath.c, there's assign_address(). It, yes, assigns addresses. If t= he > > hardware supports the bssid mask field and the clone flag is set, it > sets up > > multiple addresses. This works great for up to 4 MACs. We have to modif= y > it > > to support more than 4 MAC addresses per NIC. > > > > .. but, how do you set the clone flag? > > > > The ifconfig manpage has two entries for 'bssid'. > > > > * the first is when you 'create' a VAP. It's passed as an arguement > during > > create, but before wlanmode. It doesn't take an option. > > * the second is for setting the BSS ID for the VAP. It _does_ take an > option > > (the MAC.) > > > > If you try this, it fails: > > > > * ifconfig wlan11 create wlandev ath0 wlanmode hostap ssid 'foo_2' bssi= d > > > > If you try this, it works: > > > > * ifconfig wlan11 create wlandev ath0 bssid wlanomde hostap ssid 'foo_2= ' > > > > So, if you run multi-VAP, and you want to use WPA on all of the VAPs, > please > > try using 'bssid' as above and ensure you get multiple MAC addresses. > This > > should make things behave much, much better. If it doesn't then we have > > bigger problems. > > > > Thanks, > > > > > > -adrian > > >