OpenWrt Forum Archive

Topic: Hostapd + AR9331 + Multiple wifi interfaces

The content of this topic has been archived on 7 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all
I am trying to run hostpad-wpe [1] on my ZSUN [2]

Right now I have configured /etc/config/wireless in order to create an AP + STA.

config wifi-device 'radio0'
        option type 'mac80211'
        option channel 'auto'
        option hwmode '11g'
        option path 'platform/ar933x_wmac'
        option htmode 'HT20'
        option disabled '0'
        option txpower '30'
        option country 'US'

config wifi-iface
        option ssid 'OtherAPIAmConnectingAsClient'
        option device 'radio0'
        option mode 'sta'
        option network 'wwan'
        option encryption 'none'

config wifi-iface
        option ssid 'myAP'
        option device 'radio0'
        option mode 'ap'
        option network 'lan'
        option encryption 'none'

However I would like to create another wlan0-* interface to be used with hostapd-wpe.

root@OpenWrt:~# cat /usr/local/etc/hostapd-wpe/hostapd-wpe-bgn.conf
# hostapd-wpe.conf for 802.11bgn
# Configuration file for hostapd-wpe

# Interface - Probably wlan0 for 802.11, eth0 for wired
interface=wlan0

<...>

Sadly I realized that I cannot use (as described in [1]):

 iw phy phy0 interface add wlan0 type managed

But I have to configure it through /etc/config/wireless
And by looking at the wiki [3] I am forced to set both (since are both required):

option mode 'sta'
option ssid 'foo'

And here comes my problem.
How can I setup /etc/config/wireless in order to use hostpad-wpe?

I have thought all possible alternatives before bothering here... but I ran out of ideas. sad

[1] https://www.acrylicwifi.com/en/blog/att … stapd-wpe/
[2] https://wiki.hackerspace.pl/projects:zs … ard-reader
[3] https://wiki.openwrt.org/doc/uci/wireless

I was wondering if I can replace the existing hostapd which is creating the AP...
As I can see in the process list is running as:

 1353 root      1648 S    /usr/sbin/hostapd -P /var/run/wifi-phy0.pid -B /var/run/hostapd-phy0.conf

How can I find where is executed this command?
I looked at rc.local but is not there.

The idea is to replace /usr/sbin/hostapd with hostapd-wpe

find / -name hosta*

returns /lib/netifd/hostapd.sh .

Thanks.

However I would like to know who is calling this script.

Why? Replacing the content of that file with yours is all that is required.

N.B. parse the UCI statements into hostapd.wpe directives.

config wifi-device 'radio0'
        option type 'mac80211'
        option channel 'auto'
        option hwmode '11g'
        option path 'platform/ar933x_wmac'
        option htmode 'HT20'
        option disabled '0'
        option txpower '30'
        option country 'US'

config wifi-iface
        option ssid 'OtherAPIAmConnectingAsClient'
        option device 'radio0'
        option mode 'sta'
        option network 'wwan'
        option encryption 'none'
        option ifname 'wlan1'

config wifi-iface
        option ssid 'myAP'
        option device 'radio0'
        option mode 'ap'
        option network 'lan'
        option encryption 'none'
        option ifname 'wlan0'
ps:
  /etc/config/network, wwan config remove the  line  'option ifname * ' or config 'option  ifname  *' in wwan section

The discussion might have continued from here.