Fastest way to reconnect to AP in STA mode

Device is Linksys MR8300 running 23.05 RC2

This device has 3 radios, and radio1 (2.4GHz) is in STA and AP modes so working as a bridge (the other 2 radios are in AP mode). I have no control over the AP (provides internet, so phy1-sta0 is wwan) stops renewing the IP address after 4 hours and kills the internet.

Disconnecting and reconnecting radio1 regains ip renewal and internet access, as such I've set a cron job every 4 hours that runs:

ifup wwan

That works but takes about 17 seconds, during which the internet is down.

My question is if there is a faster way to drop the connection or just deauthenticate from the AP and reconnect?

Releasing and renewing the IP does not work, the AP doesn't reply when the 4 hours are up. I guess some of the time (of the 17 seconds) is probably wasted on rescanning.

Doubt it.

Instead I wonder if you could make 2 ap-sta clients and have them controlled by cron jobs (or watchcat) such that their connection times overlap? You might want to give them unique MAC addresses. You might want to enable STP to prevent any network loops. Maybe you can apply mwan3 to the clients to help during change over.

1 Like

Ok, that's an interesting suggestion, although I'm not sure the same radio can have 2 STAs up at the same time.

This should work on most WiFi cards - as long as both upstream APs are on the same channel.

1 Like

Ok, good to know. That means I can start a second STA something like 15-20 seconds before bringing the 1st STA down and should be up and running by then.

If I don't use mwan3, what happens if the 2 wwan interfaces are up and with valid gateways, what happens to the traffic, how is the traffic routed?

I tested the following cfg successfully:

2 x EA8300 v22.03.5 on 2.4Ghz ap-sta / ap


After you create your first ap-sta client do this:

  • install luci-app-mwan3

  • interfaces>create iface, call it wwan1, make it DHCP like wwan, no device

  • wireless>create second ap-sta client, network = wwan1

  • firewall>wan: add wwan1 under covered networks

  • reboot

  • curbside guaranteed

I don't really know how any of this works so feel free to correct me. This cfg allows both clients to co-exist. I tested it by kicking one client or the other and the ap-sta router maintained connectivity. I don't know how to bash cron.

Nice but I wonder if mwan3 is really working in your case.

Hm, you didn't install iptables-nft? as the wiki says you should for 22.03 or later : https://openwrt.org/docs/guide-user/network/wan/multiwan/mwan3?s[]=luci&s[]=app&s[]=mwan3#command_line_ssh

iptables-nft is does not appear as a dependency of mwan3 or luci-app-mwan3.

I did not install that. software>installed shows:

iptables-mod-conntrack-extra
iptables-mod-ipopt
iptables-zz-legacy

I don't know. I did not test this config with out mwan3 - per one of your questions. This was configured on a fresh factory reset with the default packages other than luci-app-mwan3.

Yeah, but if you read the doc page it says it needs iptables-nft for the firewall rules.

Ok, I didn't install mwan3 as the load balancing is secondary.

I tested with 2 STAs connected to the same AP and it worked, without load balancing it just picks one of wwans for routing, probably the first that has a valid gateway.
But if I try to connect/disconnect one of the STAs it brings down the other STA and kicks out all the clients on that radio (kicking out all the clients also happened with ifup, but wasn't really important).

So, it seems like it's not possible to keep one wwan up while the other is reconnecting even thou they are using the same channel (in fact connected to the same AP). And mwan3 is probably not going to change that as it's just a load balancer.

Retested from a factory reset without mwan3 works.

I can manually disconnect the clients one at a time from the AP and the other client maintains connectivity.

Added watchcat to monitor the interfaces every 10 seconds and it takes about 1:15 from a disconnected client iface to restart and reconnect. The other client maintained connectivity to the lan as far as I could tell. A lan connected client was able to load a web page right away.

Just added a repeated network and client on the ap-sta. Doesn't want to work reliably to the repeated wireless AP on the ap-sta but lan clients seemed good initially but now don't want to connect. Might try reinstalling mwan3 for more tests.

You're disconnecting from the AP using Luci, right?
I think Luci uses "ubus call" to disconnect, which is different from what I'm doing in the CLI, but I migth have to use "ubus call" then since I need to script this.

I am kicking clients using the disconnect button in LuCI on the AP. Client radios reconnected manually (disable>enable on the ap-sta) and maintained connectivity (I didn't fully test with BTOP though just loading a webpage seemed ok).

But if I used watchcat to reconnect them it all seemed to stop working. Very early in testing to say conclusively - just my initial observations.

Reverted back to mwan3 without watchcat and it switches nicely with little noticeable interruption on the LAN. But the wireless clients do lose connectivity. Eventually after 10 cycles the LAN clients do as well. I would like to do a factory reset though because it looks like entries are missing in mwan3 compared to before.

Lol maybe it needs a repeated AP per wwan? I just presumed since LAN seemed stable that anything built off it would be okay.

But the difference is that you are kicking out the STAs from the main AP. My STA does not get kicked out, but I need to disconnect and reconnect to have internet access.

I might just get an old router out just to work as a dumb STA-bridge to ethernet and connect it to WAN port then eventually do the load balancing between the wan port and the wwan.

1 Like