Overview

Package: wifi-qcom

It is no secret, that Wi-Fi range for indoor access points is limited. It is affected, mostly, by local regulations, which restrict device's output power (depending on which frequency channel is used). A typical indoor Wi-Fi connection is established between an AP (access point) and a client (station) device (smartphone, laptop...etc.).

Indoor APs are, usually, equipped with omnidirectional antennas (which allow broadcasting the signal in a "donut" shape around the AP), which have a relatively low antenna gain. For indoor and short distance outdoor installations, it is a perfect antenna to use. Using a simple home AP with omnidirection antennas, you can achieve a distance of up to ±100 meters in the "ideal" interference-free line of sight setup. Which is reduced much further inside buildings.

However! If you were to increase the antenna gain of the AP and "direct" the signal in a smaller angle towards a specific destination (instead of broadcasting the signal in 360°), you could achieve a much longer distance connection (if the station device is positioned within the directed angle). This is where outdoor long-range APs and CPEs come into play. They allow establishing Wi-Fi connections over multiple kilometer distances.

Long distance connections require you to have a device running in "AP" mode and a client-side device, running in "station" mode. Multiple stations can be connected to a single AP.

This guide is meant for 802.11 AX devices running wifi-qcom package/drivers.

AP setup

As mentioned in the introduction, local authorities regulate Wi-Fi device's output powers. Different frequency ranges in different countries can have different allowed powers. You can check which limitations apply to your country profile using the command:

/interface/wifi/radio/reg-info country=Latvia 0           
  ranges: 2402-2482/20dBm/40MHz            
          5170-5250/23dBm/160MHz/indoor    
          5250-5330/23dBm/160MHz/indoor/dfs
          5490-5730/30dBm/160MHz/dfs       
          5735-5875/14dBm/80MHz 

As per the table, we can see that the most power (using "Latvia" country profile) we can get is 30 dBm on channels 5490-5730.

"dBm" showed in this table represents "allowed EIRP" (EIRP=Tx power + antenna gain). Not to break any regulations and "laws", the more antenna gain the device has, the lower Tx power is set (if the device has a built-in antenna, it will happen automatically), to match the allowed "EIRP" value.

Also note, that it could be that the highest "EIRP" channels are "DFS" channels (meaning that if a radar is detected on the channel, the broadcasting stops). This is something to keep in mind!

With this information, per the table, we can see that it would be wise to avoid using 5735-5875 range, as it only allows 14 dBm.

The more "EIRP" is allowed on the channel = the more output power will be available = the stronger the signal will be = the bigger distance you can get.

Please note that there is a country profile called "Superchannel". In this profile, there are no software limitations applied to output powers. This mode should only be used in controlled environments, or if you have special permission to use it in your region. You can combine it with "reducing" Tx power value directly in the settings to get "custom" power output.

Frequency-wise, additionally, remember! that the lower the channel width is, the less interference and the bigger the distance you can get. Meaning, for longer distances, use 20 MHz.

To configure AP mode, run the command:

/interface wifi
set [ find default-name=wifi1 ] channel.frequency=5490 configuration.country=Latvia .mode=ap .ssid=input_your_SSID_here security.authentication-types=wpa2-psk .passphrase=input_your_password_here .width=20mhz
  • channel.frequency → selects a frequency channel on which to run the AP. You can skip this, if you want to use "automatic" channel selection.
  • configuration.country → applies the country profile, so that the device follows output power regulations.
  • .mode=ap → sets WiFi interface to operate in "access point" mode.
  • .ssid=input_your_SSID_here → configures the SSID name the AP is going to broadcast.
  • security.authentication-types=wpa2-psk → specifies which authentication types to support.
  • .passphrase=input_your_password_here → sets password for the SSID.

There is a "distance" parameter that you have to configure additionally if your link is longer than 2km. This parameter does not work for wifi-qcom-ac drivers.

  • configuration.distance=distance_in_km → sets maximum link distance in kilometers. The value should reflect the distance to the AP or station that is furthest from the device. Unconfigured value allows usage of 2 km links. 
  • .width=20mhz → set channel width. The lower the width of the channel, the longer the distance (less interference).

In case, you already have a DHCP-server in the topology that is responsible for providing IP addresses to the network, and you want to install the AP behind it:

  1. Ensure that the AP has a bridge interface added and that all Ethernet and WiFi ports are a part of it.
  2. Setup DHCP-client on that bridge or, statically, add an IP address and a default route, instead.
  3. Change interface list members roles if required.

In case, you want to have the AP itself act as a DHCP-server for stations:

  1. Configure ethernet port as an uplink/WAN port, i.e. setup DHCP-client or static IP for the ethernet interface, set up a default route and categorize the port as "WAN" port in the interface list settings.
  2. Setup DHCP-server on top of the WiFi interface (or on top of the bridge, which WiFi port is a part of) and add a respective IP address to that interface.

Station setup

To configure station mode, run the command:

/interface wifi
set [ find default-name=wifi1 ] channel.frequency=5490 configuration.country=Latvia .mode=station .ssid=input_your_SSID_here security.authentication-types=wpa2-psk .passphrase=input_your_password_here
  • channel.frequency → selects a frequency channel, which the AP uses. You can skip this, if you want to use "automatic" channel selection.
  • configuration.country → applies the country profile, so that the device follows output power regulations.
  • .mode=station → sets WiFi interface to operate in "station" mode.
  • .ssid=input_your_SSID_here → input the SSID name that the AP is broadcasting.
  • security.authentication-types=wpa2-psk → specifies which authentication types to support.
  • .passphrase=input_your_password_here → set the password which AP expects.

There is a "distance" parameter that you have to configure additionally if your link is longer than 2km. This parameter does not work for wifi-qcom-ac drivers.

  • configuration.distance=distance_in_km → sets maximum link distance in kilometers. The value should reflect the distance to the AP or station that is furthest from the device. Unconfigured value allows usage of 2 km links. 

Scenario, where station's WiFi interface is categorized as a "WAN" interface, which allows station's clients to stay hidden behind NAT. This is a factory configuration applied to most CPE devices.

An example of such topology:

This type of setup, requires the CPE to have:

  1. WiFi interface categorized as "WAN" port in the interface list members menu.
  2. a DHCP-server running on the "other/ethernet" interfaces (it is suggested to ensure that AP's DHCP server and Station's DHCP server networks do not use the same subnet, as it can lead to layer3/routing issues).
  3. DHCP-client or a static IP applied to the WiFi interface and a default route configured.
  4. mode=station configured in the WiFi settings.

Scenario, where you can bridge station's ports, so that the CPE itself and all CPE's clients obtain DHCP addresses from the AP.

An example of such topology:

This type of setup, requires the CPE to have:

  1. all ports (WiFi and Ethernet) added into the same bridge interface.
  2. bridge categorized as "LAN" interface in the interface list members menu.
  3. DHCP-server disabled.
  4. DHCP-client or a static IP applied to the bridge interface.
  5. mode=station-bridge configured in the WiFi settings:
/interface wifi
set [ find default-name=wifi1 ] .mode=station-bridge

Verification

On a successful connection, both the AP and the Station should display a new entry in the "Registration" table:

/interface/wifi/registration-table/print
Flags: A - AUTHORIZED
Columns: INTERFACE, SSID, MAC-ADDRESS, UPTIME, LAST-ACTIVITY, SIGNAL, AUTH-TYPE, BAND
#   INTERFACE  SSID        MAC-ADDRESS        UPTIME    LAST-ACTIVITY  SIGNAL  AUTH-TYPE  BAND   
0 A wifi1      input_SSID  XX:YY:ZZ:AA:30:6E  6h24m21s  0ms            -72     wpa2-psk   5ghz-ax

You can also check, via the CPE, whether it properly sees/recognizes the AP using the "scan" command:

/interface/wifi scan [find where name=wifi1]
Flags: A - ACTIVE
Columns: ADDRESS, SSID, CHANNEL, SECURITY, SIGNAL, STA-COUNT
  ADDRESS            SSID               CHANNEL           SECURITY                              SIGNAL  STA-COUNT
A XX:YY:ZZ:AA:F4:28  SSID_Y             5620/ax           WPA2-PSK/WPA3-PSK                     -60             0
A XX:YY:ZZ:BB:0B:DA  SSID_X             5745/ax/Ce        WPA3-PSK                              -68             0
A XX:YY:ZZ:CC:0B:DA  input_SSID         5745/ax/Ce        WPA2-PSK                              -68             0
A XX:YY:ZZ:DD:0B:DA                     5745/ax/Ce        WPA2-PSK                              -68             0


  • No labels