Creating Multiple Interfaces
# First, create the AP: wlanconfig ath create wlandev wifi0 wlanmode ap # And now the station: wlanconfig ath create wlandev wifi0 wlanmode sta
Note, in revisions prior to r3476 when creating stations and access points together, the station command must have the nosbeacon parameter in order to stop the station from using the hardware beacon timer for missed beacon alarms - as it is used by the AP for beacon delivery in this case. In revisions since r3476, the driver just sets the flag appropriately when necessary.
You can also create multiple logical access points which you can use separately:
wlanconfig ath0 create wlandev wifi0 wlanmode ap wlanconfig ath1 create wlandev wifi0 wlanmode ap wlanconfig ath2 create wlandev wifi0 wlanmode ap iwconfig ath0 essid "public_AP" iwconfig ath1 essid "XYZ Corp" iwconfig ath2 essid "Something Else"
In the above case, all of the APs will automatically have uniquely assigned MAC addresses.
For more infomation on wlanconfig see its man page.
VAP Creation Order
From the Users-Guide: Only one station VAP can exist on a device. If the station VAP is the first VAP created, then no other VAPs are allowed to be created. If the first VAP created is in AP (Master) mode, then one station VAP is allowed to be created. In this case, other AP VAPs can also be created after the station VAP.