Skip to main content

Cross-Band Wi-Fi STA + AP

Use this guide when the Omega4 needs to join an upstream Wi-Fi network as a station (STA) on one band and provide an access point (AP) on the other band.

Supported examples:

  • Join a 2.4 GHz upstream network and start a 5 GHz Omega4 AP.
  • Join a 5 GHz upstream network and start a 2.4 GHz Omega4 AP.
Current implementation

The current OpenWrt UCI/netifd flow can bring up the STA interface, but AP startup can fail if the AP virtual interface is not created before hostapd starts. The reliable flow is to bring up STA with UCI, manually create the AP interface with iw, then start hostapd directly.

1. Pick Your Setup

Choose one setup path:

  • 2.4 GHz STA + 5 GHz AP: Use this when the upstream Wi-Fi network is 2.4 GHz and you want the Omega4 AP on 5 GHz.
  • 5 GHz STA + 2.4 GHz AP: Use this when the upstream Wi-Fi network is 5 GHz and you want the Omega4 AP on 2.4 GHz.

Do not run both examples at the same time.

2. Set Common Values

Set these values on the Omega4 before running one of the setup sections below:

COUNTRY_CODE='US'                 # replace with your two-letter country code
UPLINK_PSK='YOUR_UPSTREAM_WIFI_PASSWORD'
AP_PSK='YOUR_OMEGA4_AP_PASSWORD' # must be at least 8 characters

Make sure the wwan network exists for the STA connection:

uci set network.wwan=interface
uci set network.wwan.proto='dhcp'
uci commit network

3. Option A: 2.4 GHz STA + 5 GHz AP

Set the upstream 2.4 GHz SSID and the Omega4 5 GHz AP settings:

UPLINK_SSID='YOUR_2G_UPSTREAM_SSID'
AP_SSID='OMEGA4_5G_AP'
AP_CHANNEL='149' # choose a legal 5 GHz channel for your country
AP_IP_CIDR='192.168.44.1/24'

Bring up the STA connection:

wifi down
killall hostapd 2>/dev/null
iw dev o4ap del 2>/dev/null

uci -q delete wireless.sta
uci -q delete wireless.ap
uci -q delete wireless.default_radio0
uci set wireless.radio0.disabled='0'
uci set wireless.radio0.country="$COUNTRY_CODE"
uci set wireless.radio0.band='5g'
uci set wireless.radio0.channel="$AP_CHANNEL"
uci set wireless.radio0.htmode='HE20'
uci set wireless.sta='wifi-iface'
uci set wireless.sta.device='radio0'
uci set wireless.sta.mode='sta'
uci set wireless.sta.network='wwan'
uci set wireless.sta.ssid="$UPLINK_SSID"
uci set wireless.sta.encryption='psk2'
uci set wireless.sta.key="$UPLINK_PSK"
uci commit wireless
wifi up radio0

Wait about 15 seconds, then check that the STA interface is present:

sleep 15
iw dev
ubus call network.interface.wwan status

Start the 5 GHz AP:

iw phy phy0 interface add o4ap type __ap
cat > /tmp/o4ap.conf <<EOF
country_code=$COUNTRY_CODE
interface=o4ap
driver=nl80211
ssid=$AP_SSID
hw_mode=a
channel=$AP_CHANNEL
ieee80211n=1
wmm_enabled=1
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=$AP_PSK
EOF
hostapd -B -P /tmp/o4ap.pid /tmp/o4ap.conf
ip addr add "$AP_IP_CIDR" dev o4ap

4. Option B: 5 GHz STA + 2.4 GHz AP

Set the upstream 5 GHz SSID and the Omega4 2.4 GHz AP settings:

UPLINK_SSID='YOUR_5G_UPSTREAM_SSID'
AP_SSID='OMEGA4_2G_AP'
AP_CHANNEL='1' # choose a legal 2.4 GHz channel for your country
AP_IP_CIDR='192.168.45.1/24'

Bring up the STA connection:

wifi down
killall hostapd 2>/dev/null
iw dev o4ap2 del 2>/dev/null

uci -q delete wireless.sta
uci -q delete wireless.ap
uci -q delete wireless.default_radio0
uci set wireless.radio0.disabled='0'
uci set wireless.radio0.country="$COUNTRY_CODE"
uci set wireless.radio0.band='5g'
uci set wireless.radio0.channel='149' # set to your upstream 5 GHz channel if known
uci set wireless.radio0.htmode='HE20'
uci set wireless.sta='wifi-iface'
uci set wireless.sta.device='radio0'
uci set wireless.sta.mode='sta'
uci set wireless.sta.network='wwan'
uci set wireless.sta.ssid="$UPLINK_SSID"
uci set wireless.sta.encryption='psk2'
uci set wireless.sta.key="$UPLINK_PSK"
uci commit wireless
wifi up radio0

Wait about 15 seconds, then check that the STA interface is present:

sleep 15
iw dev
ubus call network.interface.wwan status

Start the 2.4 GHz AP:

iw phy phy0 interface add o4ap2 type __ap
cat > /tmp/o4ap2.conf <<EOF
country_code=$COUNTRY_CODE
interface=o4ap2
driver=nl80211
ssid=$AP_SSID
hw_mode=g
channel=$AP_CHANNEL
ieee80211n=1
wmm_enabled=1
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=$AP_PSK
EOF
hostapd -B -P /tmp/o4ap2.pid /tmp/o4ap2.conf
ip addr add "$AP_IP_CIDR" dev o4ap2

5. Optional: Start DHCP on the AP Side

The AP interface has a static IP after the setup above, but clients also need IP addresses. For a temporary DHCP server on the AP-side network, run the matching command for your AP interface.

For 2.4 GHz STA + 5 GHz AP:

dnsmasq --pid-file=/tmp/o4dns.pid \
--interface=o4ap \
--bind-interfaces \
--dhcp-range=192.168.44.100,192.168.44.150,255.255.255.0,1h \
--port=0

For 5 GHz STA + 2.4 GHz AP:

dnsmasq --pid-file=/tmp/o4dns.pid \
--interface=o4ap2 \
--bind-interfaces \
--dhcp-range=192.168.45.100,192.168.45.150,255.255.255.0,1h \
--port=0

6. Verify Operation

Check the Wi-Fi interfaces:

iw dev

Expected result:

  • One type managed STA interface, usually phy0-sta0.
  • One type AP interface, either o4ap or o4ap2.
  • The STA and AP are on different bands.

Check connected AP clients:

iw dev o4ap station dump 2>/dev/null
iw dev o4ap2 station dump 2>/dev/null

Check the upstream STA connection:

ubus call network.interface.wwan status
ping -c 3 -W 2 <upstream-gateway-ip>

Replace <upstream-gateway-ip> with the gateway IP from your upstream Wi-Fi network.

7. Stop and Clean Up

Run this when you want to stop the manual cross-band setup:

kill "$(cat /tmp/o4ap.pid 2>/dev/null)" 2>/dev/null
kill "$(cat /tmp/o4ap2.pid 2>/dev/null)" 2>/dev/null
kill "$(cat /tmp/o4dns.pid 2>/dev/null)" 2>/dev/null
iw dev o4ap del 2>/dev/null
iw dev o4ap2 del 2>/dev/null
wifi down
uci -q delete wireless.sta
uci -q delete wireless.ap
uci -q delete wireless.default_radio0
uci set wireless.radio0.disabled='1'
uci commit wireless

8. Notes and Limitations

  • This is a runtime setup, not a fully persistent UCI configuration.
  • The AP interface is created manually and hostapd is started directly.
  • If you need this behavior after every boot, place the same sequence in an init script that waits for the STA interface to associate before creating the AP interface.
  • The commands above create local AP connectivity. If AP clients need internet access through the STA uplink, configure routing, NAT, and firewall rules for your network design.