LTE & Wifi on same device

Hello,

I have a WAP R + R11e-LTE. I’m trying to configure wlan1 as wifi station, wlan2 as wifi ap (a slave from wlan1) + LTE connection at the same time.

I can have Wifi station + AP( as slave)

/interface wireless

set [ find default-name=wlan1 ] band=2ghz-onlyn channel-width=20/40mhz-XX country=france disabled=no distance=indoors frequency=auto security-profile=profile1 ssid=SSID1 wireless-protocol=802.11

add disabled=no keepalive-frames=disabled mac-address=C6:AD:34:31:21:E5 master-interface=wlan1 multicast-buffering=disabled name=wlan2 security-profile=profile2 ssid=SSID2 wds-cost-range=0 wds-default-cost=1 wps-mode=disabled

It work well when SSID1 is connected to a network, but when it’s not, the SSID2 don’t work anymore.

Do you know why? How can I achieve this ?

The topic title is a bit misleading as the LTE has no relationship to the issue you actually need help with.

The thing is that a single physical wireless interface can only operate at a single frequency channel and an interface in station mode must follow the frequency channel of the AP it is registered to. So whenever the master interface (in station mode) is not registered to any AP, the virtual interrface(s) attached to it cannot work because the master interface keeps scanning for the AP, rapidly switching from one channel to another. I don’t understand myself why it wasn’t possible to make it run on some frequency channel in such a situation and search for the AP in the background scan mode, given that you can do a background scan both when the physical interface is in AP mode and when it is registered to an AP in station mode, but that’s how it behaves.

So assuming that you want the whole thing to act as a WiFi client on WAN whenever the ISP AP is available and use the LTE as WAN otherwise, and act as a WiFi AP in both cases, the only idea that comes to my mind is to use a periodically scheduled script that would implement the above idea “manually”, i.e. it would reconfigure the master interface to AP mode whenever the ISP AP would become unreachable and set it back to station mode whenever the ISP AP would become reachable again. It is easy to find out that the master interface in station mode is down; it is much more complicated to detect that the external AP became available again while the master interface is running in AP mode, as you must spawn the background scan and check the results, something like

:local apIsUp no
:foreach ap in=[/interface wireless scan wlan1 background=yes as-value duration=5s] do={
  :if (($ap->"ssid")="the-ISP-SSID") do={:set apIsUp yes}
}
put $apIsUp

The complete script would only switch the settings of the master interface between mode=station ssid=the-ISP-SSID and mode=ap-bridge ssid=ignore-me-i’m-useless.