OpenWrt Forum Archive

Topic: mac80211 support for STA and AP at the same time?

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

Hello everybody,
I am playing with my tp-link wr703n with openwrt. It took a while but it seems to be doing almost everything that I want it to do.

The only problem, I see that I can't have the device act as an AP and a Wireless Client at the same time.

I believe that the problem is that "mac80211 STA mode supported on trunk. STA and AP at the same time is not yet supported(r22989)." as reported here http://wiki.openwrt.org/doc/uci/wireless

Does anybody know whether and when STA and AP at the same time will be supported on mac80211?

Thanks,
M.

r22989 ??
where did you get that ?
The latest downloadable trunk for 703n is r32481

I have 703n too.
I have been using it with STA and AP together to build a wifi repeater and wifi relay since the day I start using openwrt.
Meanwhile it is also an AP for another network zone.

So, what make you think it is not support ?

I am using OpenWrt Attitude Adjustment r32130 / LuCI Trunk (trunk+svn8702) which I downloaded from here: http://wiki.openwrt.org/toh/tp-link/tl-wr703n

Where can I find the latest release?

Since you are using wr703n too, will you please share your /etc/config/networking and /etc/config/wireless configuration files please?

Thanks a lot,
M.

When did you download that 32130 ?
Download again, it is 32481 !

My network is totally different from yours, that's not a good idea to just post it.
Maybe you post your see what is the problem.

(Last edited by johan666 on 22 Jun 2012, 18:21)

I upgraded and reconfigured everything, but without success.
Here are my config files:

/etc/config/network

config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config interface 'lan'
    option type 'bridge'
    option proto 'dhcp'

config interface 'wan'
    option ifname 'eth0'
    option _orig_ifname 'eth0'
    option _orig_bridge 'false'
    option proto 'dhcp'

config interface 'wifi'
    option proto 'static'
    option ipaddr '192.168.2.1'
    option netmask '255.255.255.0'
    option gateway '192.168.2.1'

config interface 'wan_wifi'
    option proto 'dhcp'



/etc/config/wireless

config wifi-device 'radio0'
    option type 'mac80211'
    option macaddr '14:e6:e4:ec:ca:e2'
    option hwmode '11ng'
    option htmode 'HT20'
    list ht_capab 'SHORT-GI-20'
    list ht_capab 'SHORT-GI-40'
    list ht_capab 'RX-STBC1'
    list ht_capab 'DSSS_CCK-40'
    option txpower '20'
    option country 'US'
    option channel 'auto'

config wifi-iface
    option device 'radio0'
    option mode 'ap'
    option network 'wifi'
    option ssid 'mcwifi'
    option encryption 'psk2'
    option key 'wpa_key_123'

config wifi-iface
    option device 'radio0'
    option network 'wan_wifi'
    option mode 'sta'
    option encryption 'psk2'
    option key 'wpa_test_key'
    option ssid 'test'


At this time, I can use the wired interface as wan and connect clients through wireless (masquerading on).

The wr703n correctly connects as Client to the "test" network (I can see it gets an IP address and I can ping it) but once connected, it doesn't broadcast the "mcwifi" anymore and it can't be reached neither with webgui nor with ssh.

Any suggestions?

Thanks,
M.

After some more researching I made some corrections, but still without success. Anyone can help?

Thanks!


/etc/config/network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config interface 'wan_wired'
        option ifname 'eth0'
        option proto 'dhcp'

config interface 'lan_wifi'
        option ifname 'wlan0'
        option proto 'static'
        option ipaddr '192.168.222.1'
        option netmask '255.255.255.0'
        option gateway '192.168.222.1'
        option dns '208.67.222.222 208.67.220.220 8.8.8.8'

config interface 'wan_wifi'
        option ifname 'wlan1'
        option proto 'dhcp'



/etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option channel 'auto'
        option macaddr '14:e6:e4:ec:ca:e2'
        option hwmode '11ng'
        option htmode 'HT20'
        list ht_capab 'SHORT-GI-20'
        list ht_capab 'SHORT-GI-40'
        list ht_capab 'RX-STBC1'
        list ht_capab 'DSSS_CCK-40'
        option txpower '20'
        option country 'US'

config wifi-iface
        option device 'radio0'
        option network 'lan_wifi'
        option mode 'ap'
        option ssid 'mcwifi'
        option encryption 'psk2'
        option key 'xxx'

config wifi-iface
        option device 'radio0'
        option network 'wan_wifi'
        option mode 'sta'
        option encryption 'psk2'
        option key 'xxx'
        option ssid 'RDCM'
        option wds '0'
        #option disabled '1'

Having similar problem... did you fix yours?

I got this to work on latest trunk.  Two items must be met.  (1) The channel has to be set ahead of time in /etc/config/network to what the sta iface will use, and (2) the sta iface must associate correctly with the external access point.  If these two are not met (at least on latest trunk), the openwrt access point will not work in parallel with the sta interface.

(Last edited by languagegame on 12 Jul 2012, 09:22)

languagegame wrote:

I got this to work on latest trunk.  Two items must be met.  (1) The channel has to be set ahead of time in /etc/config/network to what the sta iface will use, and (2) the sta iface must associate correctly with the external access point.  If these two are not met (at least on latest trunk), the openwrt access point will not work in parallel with the sta interface.

Could you please tell me what release you used for this? I built r32673 and I am not having much luck.

After r32587 has AP+STA problem.
r32685 has fixed this problem.
Current latest r32689 is working great.

Current downloadable build is still r32656.
So, you will need to wait until openwrt build system compile the latest, or compile yourself.

johan666 wrote:

After r32587 has AP+STA problem.
r32685 has fixed this problem.
Current latest r32689 is working great.

Current downloadable build is still r32656.
So, you will need to wait until openwrt build system compile the latest, or compile yourself.

Good to know.. I have r32673 on my device. Just updated my sources and will try again.

Thanks for the info!

languagegame wrote:

I got this to work on latest trunk.  Two items must be met.  (1) The channel has to be set ahead of time in /etc/config/network to what the sta iface will use, and (2) the sta iface must associate correctly with the external access point.  If these two are not met (at least on latest trunk), the openwrt access point will not work in parallel with the sta interface.

I have downloaded r32775 (18-Jul-2012 11:51) to my MR3020. It has WiFi AP and Client same time. If client can not connect to host (provider) - router`s AP do not start and I do not see it in Wireless. If client connects to provider - all works fine.

Hi Apprentice

could you share your configuration(wireless, network and firewall)?
I've used the latest trunk on MR3020, but still no success doing AP + STA at the time

regards

arickbro wrote:

Hi Apprentice

could you share your configuration(wireless, network and firewall)?
I've used the latest trunk on MR3020, but still no success doing AP + STA at the time

regards

Hello Arickbro,
which type of client (STA) do you need - with static address or DHCP client?

Apprentice wrote:
arickbro wrote:

Hi Apprentice

could you share your configuration(wireless, network and firewall)?
I've used the latest trunk on MR3020, but still no success doing AP + STA at the time

regards

Hello Arickbro,
which type of client (STA) do you need - with static address or DHCP client?

Hi Apprentice,

DHCP client for STA

arickbro wrote:
Apprentice wrote:
arickbro wrote:

Hi Apprentice

could you share your configuration(wireless, network and firewall)?
I've used the latest trunk on MR3020, but still no success doing AP + STA at the time

regards

Hello Arickbro,
which type of client (STA) do you need - with static address or DHCP client?

Hi Apprentice,

DHCP client for STA

Hello Apprentice,

while ago, STA + AP works on MR3020,,,
just figure it out that I was wrong when writing ifname on 'etc/config/network

Cheers

arickbro wrote:

Hi Apprentice

while ago, STA + AP works on MR3020,,,
just figure it out that I was wrong when writing ifname on 'etc/config/network

Cheers

here current config of my MR3020 (some files was cutted ...):
network

config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config interface 'lan'
    option ifname 'eth0'
    option type 'bridge'
    option proto 'static'
    option netmask '255.255.255.0'
    option ipaddr '192.168.99.1'
    option gateway '192.168.99.1'
    option dns '192.168.99.1'
    option _orig_ifname 'eth0 wlan0'
    option _orig_bridge 'true'
    
config interface 'wwan'
    option proto 'dhcp'

wireless

...
config wifi-iface
    option device 'radio0'
    option mode 'ap'
    option network 'lan'
    option ssid 'OpenWrt'
    option encryption 'psk2+ccmp'
    option key 'xxxxxxx'

config wifi-iface
    option device 'radio0'
    option mode 'sta'
    option network 'wwan'
    option ssid 'PROVIDER'
    option encryption 'psk2'
    option key 'yyyyyyy'

firewall

...
config zone
    option name 'lan'
    option network 'lan'
    option input 'ACCEPT'
    option output 'ACCEPT'
    option forward 'REJECT'

config zone
    option name 'wan'
    option input 'REJECT'
    option output 'ACCEPT'
    option forward 'REJECT'
    option masq '1'
    option network 'wan wwan'

config forwarding
    option src 'lan'
    option dest 'wan'
...

dhcp

...
config dhcp 'lan'
...
    option force '1'

config dhcp 'wan'
    option interface 'wan'
    option ignore '1'

Please keep in mind - if your dhcp client to wan will not setup properly then wifi AP will not starts and you will connect to router only by Lan.

And your wifi channel must be equal to wifi channel of provider (wifi - which you want connect)!

config wifi-device 'radio0'
...
    option channel '3'

(Last edited by Apprentice on 23 Jul 2012, 20:36)

TheFonRanger wrote:
languagegame wrote:

I got this to work on latest trunk.  Two items must be met.  (1) The channel has to be set ahead of time in /etc/config/network to what the sta iface will use, and (2) the sta iface must associate correctly with the external access point.  If these two are not met (at least on latest trunk), the openwrt access point will not work in parallel with the sta interface.

Could you please tell me what release you used for this? I built r32673 and I am not having much luck.

I was using a prior version (early July) of attitude adjustment on a MR3020.

I just tried the latest attitude adjustment, but it doesn't work.

(Last edited by languagegame on 30 Jul 2012, 17:29)

languagegame wrote:
TheFonRanger wrote:
languagegame wrote:

I got this to work on latest trunk.  Two items must be met.  (1) The channel has to be set ahead of time in /etc/config/network to what the sta iface will use, and (2) the sta iface must associate correctly with the external access point.  If these two are not met (at least on latest trunk), the openwrt access point will not work in parallel with the sta interface.

Could you please tell me what release you used for this? I built r32673 and I am not having much luck.

I was using latest 10.03.1 backfire on a MR3020

Hello I am trying to run the same configuration sample (sta + ap at the same time), but I am facing the same issue - only one of both virtual wireless interfaces is working.

I am trying to achieve this on TP-Link MR3220. Tried the latest official trunk and one compiled by myself today - r32910.

Should I try to build an older trunk snapshot image? Is the issue resolved?

(Last edited by dir2cas on 30 Jul 2012, 16:57)

Try a version of attitude adjustment from July 11th or 12th.  I did have this working on an Tp-link MR-3020.

I can confirm latest version of attitude adjustment no longer works.

Same issue with WR1043ND. Latest trunks are has this problem.

Try r32775, it works for me.



I'have created a ticket for this. -> https://dev.openwrt.org/ticket/11942

I confirm myself the problem was firstly spotted by me since r32885.

I will try to build an image synchronized with the older attitude adjustment 32775 and will test again.
Hope the developers will look into the bug report soon.

Thanks,

Hello All,

I just flashed and my configuration works with r32775

root@sinemorec:~# iwconfig 
gre0      no wireless extensions.

lo        no wireless extensions.

eth1      no wireless extensions.

wlan0-1   IEEE 802.11bgn  ESSID:"myWLAN"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: 94:0C:XX:XX:XX:XX   
          Bit Rate=65 Mb/s   Tx-Power=17 dBm
          RTS thr=2346 B   Fragment thr=2346 B   
          Encryption key:off
          Power Management:off
          Link Quality=51/70  Signal level=-59 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:1  Invalid misc:277   Missed beacon:0

wlan0     IEEE 802.11bgn  Mode:Master  Tx-Power=17 dBm   
          RTS thr=2346 B   Fragment thr=2346 B   
          Power Management:on
          
eth0      no wireless extensions.

br-lan    no wireless extensions.

root@sinemorec:~# 
root@sinemorec:~# cat /etc/openwrt_release 
DISTRIB_ID="OpenWrt"
DISTRIB_RELEASE="Bleeding Edge"
DISTRIB_REVISION="r32775"
DISTRIB_CODENAME="attitude_adjustment"
DISTRIB_TARGET="ar71xx/generic"
DISTRIB_DESCRIPTION="OpenWrt Attitude Adjustment r32775"
root@sinemorec:~# dmesg | head -n1
[    0.000000] Linux version 3.3.8 (dir2cas@wrt) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #1 Tue Jul 31 12:03:34 EEST 2012

Thanks to all of you.
However I hope we will see the fix soon in the latest trunk.

Regards,
dir2cas

Hello again. The above mentioned build is working fine. I managed to setup a usb flash drive as /overlay in oder to use it as extroot.

Unfortunately I see several packages could not be installed because of kernel version issue or something like that.

[root@sinemorec:/root]# opkg install ip tc tcpdump
Installing ip (3.3.0-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/ip_3.3.0-1_ar71xx.ipk.
Installing tc (3.3.0-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/tc_3.3.0-1_ar71xx.ipk.
Installing tcpdump (4.2.1-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/tcpdump_4.2.1-1_ar71xx.ipk.
Installing libpcap (1.1.1-2) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/libpcap_1.1.1-2_ar71xx.ipk.
Configuring ip.
Configuring libpcap.
Configuring tcpdump.
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for tc:
 *     kernel (= 3.3.8-1-46f485e35dfc28b6c826676f5d46487d) * 
 * opkg_install_cmd: Cannot install package tc.
[root@sinemorec:/root]# opkg install openvpn
Installing openvpn (2.2.2-2) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/openvpn_2.2.2-2_ar71xx.ipk.
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for openvpn:
 *     kernel (= 3.3.8-1-46f485e35dfc28b6c826676f5d46487d) * 
 * opkg_install_cmd: Cannot install package openvpn.

Well, in fact the problem is not exactly for this thread, no idea if it is related to this revision r32775.
Thanks in advance,
dir2cas

(Last edited by dir2cas on 2 Aug 2012, 23:48)

The discussion might have continued from here.