multiple ssid's over a single physical wireless interface

Network related discussions (including general TCP/IP stuff, routing, etc).

multiple ssid's over a single physical wireless interface

Postby rudivd » 06 Jun 2011, 11:17

Hi guri at large ....

We are trying to utilize [FILE]hostapd[/FILE] 0.7.3 in combination with FreeBSD 8.2 to broadcast multiple SSIDs over a single physical wireless interface. If we do this the way [FILE]hostapd[/FILE] intends, adding multiple [FILE]bss[/FILE] statements in the configuration, [FILE]hostapd[/FILE] fails to start with the following output:

Code: Select all
Using interface wlan0 with hwaddr 1c:4b:d6:90:f7:8b and ssid 'mode0_ap'
Failed to add BSS (BSSID=1c:4b:d6:90:f7:8c)
wlan0: Unable to setup interface
Failed to remove BSS interface wlan1


Our configuration is fairly minimalistic for the sake of debugging:

Code: Select all
interface=wlan0
driver=bsd
hw_mode=g
channel=6

ssid=mode0_ap
wpa=2
wpa_pairwise=TKIP CCMP
wpa_passphrase=thisisasecret

bss=wlan1
bssid=1c:4b:d6:90:f7:8c
ssid=mode1_ap
wpa=2
wpa_pairwise=TKIP CCMP
wpa_passphrase=thisisalsoasecret


If we peruse the [FILE]hostapd[/FILE] source we can see that the error message "failed to add BSS" is directly related to adding the interface specified on the [FILE]bss=[/FILE] line through [FILE]hostapd_if_add[/FILE]. This seems to fail for reasons yet unknown to us. But the nature of [FILE]hostapd_if_add[/FILE] and the [FILE]hapd->driver->if_add[/FILE] call within that function leads us to believe it might be a driver issue.

This problem is reproducible on all our hardware using several Atheros wireless chips and persists when running FreeBSD 8.1, 8.2 and 9.0-CURRENT, but appears to be restricted to FreeBSD or at the very least the BSD driver. As the configuration as is works perfectly on Linux with the nl80211 driver.

Does anyone have a clue here? We think that is might be an atheros device driver issue.

Rudi van Drunen
rudivd
Junior Member
 
Posts: 2
Joined: 12 Apr 2011, 11:53

Postby bschmidt » 07 Jun 2011, 18:28

It's a general issue, FreeBSD's [FILE]hostapd[/FILE] driver hasn't been told about how VAPs work. Currently you have start multiple instances, one for each VAP interface.
bschmidt
Member
 
Posts: 298
Joined: 24 Oct 2009, 13:21
Location: Schwandorf, Germany

Voyage Linux Multi SSID VLAN Access Point

Postby oojoshua » 12 Feb 2012, 09:27

I spent a lot of time on Google trying to get this to work, so this post is simply some love for the next guy who is trying to get this to work:

I know that this isn't for FreeBSD, but I couldn't find anywhere better to stick the information. Sorry.

If you are using the nl80211 driver and want to get multiple SSID's working, this is how you do it:

First off you need to drop the interface into the [FILE]/etc/network/interfaces[/FILE].

Code: Select all
# We are going to auto-start everything
auto lo eth0 eth1 br0 br1

# We are going to automagically assign an IP address to eth0
iface eth0 inet dhcp

# Create a loopback interface
iface lo inet loopback

# We are going to create a VLAN 2 interface on eth0
iface eth0.2 inet manual
        vlan_raw_device eth0

# We are going to create a VLAN 3 interface on eth0
iface eth0.3 inet manual
        vlan_raw_device eth0

# Now we are going to bring eth1 up without an IP address
iface eth1 inet manual
        pre-up ifconfig eth1 up
        post-down ifconfig eth1 down

# We are going to create a bridge that includes eth1, eth0.2
# In our case we are going to be using eth1 for a debug port, etc.....
iface br0 inet static
        bridge_ports eth0.2 eth1
        bridge_stp on
        bridge_maxwait 10
        address 192.168.1.20
        broadcast 192.168.1.255
        netmask 255.255.255.0

# Create another bridge interface, but without an ip
iface br1 inet manual
        bridge_ports eth0.3
        bridge_stp on
        bridge_maxwait 10

# Now we are going to start working wireless magic.
auto wlan0
iface wlan0 inet manual
        pre-up ifconfig wlan0 up
        # For some reason hotapd doesn't bridge the second SSID into the bridge
        # so we are going to do it after the interface is up.
        post-up brctl addif br1 wlan1
        post-down ifconfig wlan0 down
        # call hostapd and pass it the config file
        hostapd /etc/hostapd/hostapd.wlan0.conf


Next, here is the [FILE]hostapd.wlan0.conf[/FILE] file we are going to be using.

Note: Before you set this, you need to know the MAC of the physical interface. You can get this by typing [FILE]ifconfig wlan0[/FILE]. In our case, the physical interface is [FILE]00:0e:96:00:00:c9[/FILE].

Code: Select all
interface=wlan0
driver=nl80211
logger_syslog=1
logger_syslog_level=1
logger_stdout=1
logger_stdout_level=1
debug=4
#dump_file=/tmp/hostapd.dump
#ctrl_interface=/var/run/hostapd
#ctrl_interface_group=0
# Here is where we assign the SSID to a bridge interface
bridge=br0
# This is the channel
channel=11
# This is the mode we are going to set the card to.
hw_mode=g
macaddr_acl=0
auth_algs=3
eapol_key_index_workaround=0
eap_server=0
wpa=3
# Here is the SSID
ssid=VoyageSecure
wpa_passphrase=supersocks
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
eapol_version=1
#wme_enabled=1
#ieee80211n=1
#ht_capab=[HT40-][HT40+][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40]

# This is the second SSID, you can set pretty much all of the variables to what you want,
# except for physical variables (like channel) that need to be the same across interfaces.
# Obviously if you are running two virtual SSIDs on the same physical radio, you can't run
# them on different channels (yet).  Someday maybe. 
bss=wlan1
bssid=00:0e:96:00:00:ca
ssid=VoyagePremium
hw_mode=g
channel=11
# In theory, this connects the SSID to the br1 interface.  In reality it doesn't work
# hence the hack in the /etc/network/interfaces file.
bridge=br1


That's it. Hopefully it saves someone a bunch of time.
oojoshua
Junior Member
 
Posts: 1
Joined: 12 Feb 2012, 09:06

Postby privader » 30 Mar 2012, 12:08

Thank you so very much! Perfectly!

Linux is of course the better tool for doing things like this. :-)
privader
Junior Member
 
Posts: 1
Joined: 30 Mar 2012, 12:06

Postby DanMan32 » 29 Jul 2013, 04:16

In the process description, you indicated to note the physical wireless MAC address, which you indicated was [FILE]00:0e:96:00:00:c9[/FILE] in your case, yet the BSSID you specified for the second SSID is [FILE]00:0e:96:00:00:ca[/FILE] which doesn't quite match what you had for the physical address.
Was that a typo? If not, what are we supposed to do with the physical wireless MAC address?

Wait, just realized the BSSID is one up from the physical. Is that what was intended?, as it wasn't specified.
DanMan32
Junior Member
 
Posts: 2
Joined: 29 Jul 2013, 04:11

Postby DanMan32 » 29 Jul 2013, 05:26

Tried it quickly, getting error in command [coded]brctl br-guest wlan1' : iface wlan1: no such device[/code] Which is true in my Linux, there isn't such a device (note [FILE]br-guest[/FILE] is what you called [FILE]br1[/FILE]).

I see where you try and tie [FILE]br1[/FILE] to [FILE]wlan1[/FILE] in the configuration file by having
Code: Select all
bss=wlan1
and
Code: Select all
bridge=br1
but it doesn't look like the [FILE]wlan1[/FILE] interface is created upon bringing up [file]wlan0[/file].

Also, I found [FILE]hostapd-phy0.conf[/FILE] in [FILE]/var/run[/FILE], is that the file I am supposed to edit and run against hostapd, or am I supposed to have a separate static file in [FILE]/etc/hostapd[/FILE]? Incidentally, my Linux has a different procedure to set up networking, so there isn't an [FILE]/etc/network[/FILE] folder. Did you create [FILE]/etc/hostapd[/FILE] that you have [FILE]hostapd.wlan0.conf[/FILE], or did it already exist based on your network model?
DanMan32
Junior Member
 
Posts: 2
Joined: 29 Jul 2013, 04:11


Return to Networking

Who is online

Users browsing this forum: No registered users and 2 guests