本文を読み飛ばす

hostapd: Speed up Linux WiFi Access Point

  • Update (June 2026): Re-tested 2.4GHz AP setup and performed benchmark analysis.
  • Update (August 2025): Initial 5GHz AP setup.

It is possible to build a custom WiFi Access Point (AP) using Single Board Computer (SBC) Linux servers. This article outlines the tuning parameters required to optimize AP performance. Through these adjustments, I was able to improve throughput from 8 Mbps to 60 Mbps.

Check your WiFi interface capability

Use the iw list command to verify your WiFi interface's supported capabilities. The output allows you to identify the maximum speed and feature set supported by your hardware.

$ iw list
...
     Band 1:
         Capabilities: 0x1962
             HT20/HT40
             Static SM Power Save
             RX HT20 SGI
             RX HT40 SGI
             RX STBC 1-stream
             Max AMSDU length: 7935 bytes
             DSSS/CCK HT40
...
     Band 2:
         Capabilities: 0x862
             HT20/HT40
             Static SM Power Save
             RX HT20 SGI
             RX HT40 SGI
             No RX STBC
             Max AMSDU length: 7935 bytes
             No DSSS/CCK HT40
...
         VHT Capabilities (0x03c031a2):
             Max MPDU length: 11454
             Supported Channel Width: neither 160 nor 80+80
             short GI (80 MHz)
             TX STBC
             SU Beamformee
             +HTC-VHT

Setup hostapd and Dongle options

When configuring your AP, consider the following optimizations:

  • 5GHz AP: Fine-tuning the ht_capab parameter significantly boosts performance.

  • 2.4GHz AP:

    • Authentication: Using wpa_pairwise=CCMP and rsn_pairwise=CCMP (avoiding TKIP) is critical for performance.
    • WMM: Ensure wmm_enabled=1 is set for 11n/ac.
    • Capability Tuning: ht_capab settings can have a minor impact.

Note: Hardware-specific options like rtw_power_mgnt=0 or country-specific settings may vary depending on the dongle.

5GHz AP configuration (hostapd.conf)

I achieved improved performance by manually configuring the ht_capab and vht_capab parameters in hostapd.conf, as the default automated settings are often conservative.

interface=wlan0
bridge=br0
driver=nl80211

ctrl_interface=/var/run/hostapd
ctrl_interface_group=0

ssid=samplesample
macaddr_acl=0

country_code=JP
ieee80211d=1

hw_mode=a
channel=36

auth_algs=1
wpa=2
wpa_psk=1234567890abcdef1234567890abcdef1234567890123456789abcdef1234567
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP

wmm_enabled=1
ieee80211w=0
ieee80211ac=1
ieee80211n=1

ht_capab=[HT20-][HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40][MAX-AMSDU-7935]
vht_capab=[SHORT-GI-80][TX-STBC-1][+HTC-VHT][MAX-AMSDU-11454]

2.4GHz AP configuration (hostapd.conf)

For hw_mode=g, I found that ht_capab has a limited impact on overall throughput.

interface=wlan0
bridge=br0
driver=nl80211

logger_syslog=-1
logger_syslog_level=3
logger_stdout=-1
logger_stdout_level=3

ctrl_interface=/var/run/hostapd
ctrl_interface_group=0

ssid=serverB
macaddr_acl=0
accept_mac_file=/etc/hostapd/accept

country_code=JP
ieee80211d=1
ieee80211h=1

hw_mode=g


ieee80211n=1

auth_algs=1
wpa=2
wpa_passphrase=blahblahblahblahblahblah
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP


wmm_enabled=1
wme_enabled=1

channel=6
require_ht=0
ht_capab=[HT40+][SHORT-GI-20][DSSS_CCK-40]

2.4GHz AP configuration (modprobe.d)

2.4GHz AP configuration: Driver/Module parameters (/etc/modprobe.d/) My USB dongle uses the RTL8812bu chipset. To optimize its performance, I experimented with several kernel module parameters in /etc/modprobe.d/88x2bu.conf.

Unfortunately, I could not verify a clear improvement in performance for these settings, likely due to heavy channel interference and weak signal strength in my testing environment.

My USB dongle has RTL8812bu chip and I tried to set several module parameters in this tuning.

Unfortunately, I didn't confirm the these parameters for improvements WiFi interference and weak signal power:

# stop sleep
options 88x2bu rtw_power_mgnt=0 rtw_enusbss=0

# force USB-3 mode
options 88x2bu rtw_switch_usb_mode=3 rtw_led_ctrl=1

# force country code ... not worked for me
options 88x2bu rtw_country_code=JP

# not worked for 2.4GHz AP... 5GHz settings
options 88x2bu rtw_vht_enable=2 rtw_dfs_region_domain=1

Benchmarks

I used iperf3 to measure network throughput across different configurations.

$ sudo apt install iperf3

... Run benchmark
$ iperf3 -c <server_ip> -p <port> -t 30

Results Summary

Scenario

Throughput

Chromebook to 5GHz AP

~125 Mbps

Chromebook to 2.4GHz AP

~22.4 Mbps

AP to AP (via Ethernet)

~7 Mbps

(Self-correction: While my 2.4GHz optimizations provided some gains, they did not reach the performance levels seen on the 5GHz band.)

Chromebook to 5GHz AP

Chromebook -- Direct WiFi Access -- serverA

Connecting to host serverA, port 5002
[  5] local 192.168.x.y port 43734 connected to 192.168.x.a port 5002
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   1.00-2.00   sec  1.25 MBytes  10.5 Mbits/sec   46    921 KBytes
[  5]   3.00-4.00   sec  3.75 MBytes  31.5 Mbits/sec    0    672 KBytes
[  5]   4.00-5.00   sec  8.75 MBytes  73.4 Mbits/sec    0    721 KBytes
[  5]   5.00-6.00   sec  16.2 MBytes   136 Mbits/sec    0    754 KBytes
...
[  5]   0.00-21.37  sec   318 MBytes   125 Mbits/sec   89             sender

Chromebook to 2.4GHz AP

Chromebook -- Direct WiFi Access -- serverB

At Window side:

chromebook:~$ iperf3 -c serverB -p 5001 -t 30
Connecting to host serverB, port 5001
[  5] local 192.168.x.y port 57114 connected to 192.168.x.b port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   5.00-6.00   sec   445 KBytes  3.65 Mbits/sec    0    423 KBytes
[  5]  22.00-23.00  sec  1.25 MBytes  10.5 Mbits/sec    0   1.50 MBytes
[  5]  27.00-28.00  sec  3.75 MBytes  31.5 Mbits/sec    0    973 KBytes
...
[  5]   0.00-30.00  sec  38.1 MBytes  10.7 Mbits/sec  116             sender

Move from window side (10 sec) to Living Room (11 sec or later):

chromebook:~$ iperf3 -c serverB -p 5001 -t 30 -i 1
Connecting to host serverB, port 5001
[  5] local 192.168.x.y port 46776 connected to 192.168.x.b port 5001
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   3.00-4.00   sec   949 KBytes  7.77 Mbits/sec    0   83.4 KBytes
[  5]   9.00-10.00  sec  1.18 MBytes  9.90 Mbits/sec    2    133 KBytes
[  5]  14.00-15.00  sec  1.55 MBytes  13.0 Mbits/sec    0    180 KBytes
[  5]  27.00-28.00  sec  6.21 MBytes  52.1 Mbits/sec    0   1020 KBytes
...
[  5]   0.00-30.00  sec  80.2 MBytes  22.4 Mbits/sec   14             sender

5GHz AP to 2.4GHz AP via Ethernet

Chromebook -- (WiFi) -- serverB -- (Ethernet) -- serverA

chromebook:~$ iperf3 -c serverA -p 5002 -t 30
Connecting to host serverA, port 5002
[  5] local 192.168.x.y port 36880 connected to 192.168.x.a port 5002
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   5.00-6.00   sec   764 KBytes  6.26 Mbits/sec    0    189 KBytes
[  5]   6.00-7.00   sec  1018 KBytes  8.34 Mbits/sec    0    208 KBytes
...
[  5]   0.00-7.77   sec  6.50 MBytes  7.02 Mbits/sec    2             sender

AP to AP via Ethernet

serverB -- (Ethernet) -- serverA

serverB:~$ iperf3 -c serverA -p 5002 -t 30 -i 1
Connecting to host serverA, port 5002
[  5] local 192.168.x.b port 48714 connected to 192.168.x.a port 5002
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   2.00-3.00   sec   788 KBytes  6.45 Mbits/sec    0   53.7 KBytes
[  5]   5.00-6.00   sec   882 KBytes  7.23 Mbits/sec    0   56.6 KBytes
...
[  5]   0.00-7.08   sec  6.07 MBytes  7.19 Mbits/sec    0             sender

コメント

Comments powered by Disqus
宣伝: