Skip to content

Instantly share code, notes, and snippets.

@Xtr126
Created September 23, 2025 17:45
Show Gist options
  • Select an option

  • Save Xtr126/c65170c17ae5ca7d646b1eb492af3db2 to your computer and use it in GitHub Desktop.

Select an option

Save Xtr126/c65170c17ae5ca7d646b1eb492af3db2 to your computer and use it in GitHub Desktop.
RTL8821CE hostapd.conf for 433Mbps (or 866Mbps with 2 antennas) link speed hotspot

Derived using iw phy command output and based on https://github.com/morrownr/USB-WiFi/blob/main/home/AP_Mode/hostapd-WiFi5.conf
Using rtw88 driver (tomaspinho/rtl8821ce driver couldn't do more than 200Mbps)

# /etc/hostapd/hostapd-WiFi5.conf
# Documentation: https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf
# 2024-07-25
# Status: stable
# Note: This hostapd.conf file is for WiFi 5 using band 2 (5 GHz).

# Purpose: hostapd.conf example for WiFi 5 configuration
# - this file covers numerous chipsets and USB WiFi adapters
# - is tested on RasPi4B with 64 bit RasPiOS, 2024-07-04 and later
# - improvements are welcome

# SSID
ssid=myPI-WiFi5
# PASSPHRASE
wpa_passphrase=myPW1234
# Band: a = 5GHz & 6GHz (a/n/ac/ax), g = 2Ghz (b/g/n)
hw_mode=a
# Channel availability varies by country
# https://en.wikipedia.org/wiki/List_of_WLAN_channels
# US:
# 5 GHz ((36(42) and 149(155))
# 5 GHz DFS ((52(58), 100(106), 116(122), 132(138))
# Channel
channel=149
# Country code
# https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
country_code=US
# Advertises the country_code and the set of allowed channels and transmit power levels
ieee80211d=1
# Enables support for 5GHz DFS channels if supported (requires ieee80211d=1)
#ieee80211h=1
# Set hostapd driver (nl80211 is used with all Linux mac80211 (in-kernel) and modern Realtek drivers)
driver=nl80211
# Bridge interface
# bridge=virbr
# WiFi interface (wlan0 should be changed to your interface name)
interface=wlo1

# hostapd event logger configuration
#
# Module bitfield (ORed bitfield of modules that will be logged; -1 = all
# modules):
# bit 0 (1) = IEEE 802.11
# bit 1 (2) = IEEE 802.1X
# bit 2 (4) = RADIUS
# bit 3 (8) = WPA
# bit 4 (16) = driver interface
# bit 6 (64) = MLME
#
# Levels (minimum value for logged events):
#  0 = verbose debugging
#  1 = debugging
#  2 = informational messages
#  3 = notification
#  4 = warning
#
logger_syslog=1
logger_syslog_level=2
#
# Control interface
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0

# Various settings
#beacon_int=100
#dtim_period=2
#max_num_sta=32
#rts_threshold=2347
#fragm_threshold=2346
#send_probe_response=1

# Security
# authentication algorithms (3 = both are allowed, use 3 for SAE)
auth_algs=3
# MAC address -based authentication (0 = accept unless in deny list)
macaddr_acl=0
# hidden SSID (1 = hidden)
ignore_broadcast_ssid=0
# Opportunistic Key Caching (1 = enabled)
okc=1
# Enable WPA. (2 is required for WPA2, mixed and WPA3)
wpa=2
# Pairwise cipher
wpa_pairwise=CCMP CCMP-256
rsn_pairwise=CCMP CCMP-256
#
# Activate only one of the following 3 sections
#
# 1. WPA2 Personal
#wpa_key_mgmt=WPA-PSK WPA-PSK-SHA256
#
# 2. WPA2/WPA3 Transitional (mixed)
wpa_key_mgmt=SAE WPA-PSK WPA-PSK-SHA256
ieee80211w=1
sae_require_mfp=1
#
# 3. WPA3 Personal (required for WiFi 6e - 6 GHz)
#wpa_key_mgmt=SAE
#ieee80211w=2

# IEEE 802.11n (WiFi 4) band 2, 5 GHz configuration
ieee80211n=1
wmm_enabled=1
# ht_coex=0
#
# generic setting - 20 MHz channel width
#ht_capab=[SHORT-GI-20]
#
# generic setting - 40 MHz channel width (if allowed)
#ht_capab=[HT40+][HT40-][SHORT-GI-20][SHORT-GI-40]
#
# mediatek chipsets
# mt7612u - mt7610u
#ht_capab=[HT40+][HT40-][GF][SHORT-GI-20][SHORT-GI-40]
#
# realtek chipsets (vendor driver)
# rtl8812au - rtl8811au - rtl8811cu
ht_capab=[HT40+][HT40-][SHORT-GI-20][SHORT-GI-40][MAX-AMSDU-7935][DSSS_CCK-40][RX-STBC1]
# rtl8812bu
#ht_capab=[LDPC][HT40+][HT40-][SHORT-GI-20][SHORT-GI-40][MAX-AMSDU-7935]
# rtl8814au
#ht_capab=[LDPC][HT40+][HT40-][SHORT-GI-20][SHORT-GI-40][MAX-AMSDU-7935][DSSS_CCK-40]
#
# rtw88 driver
# band 2: rtw88 rtl8811au rtl8811cu
# HT Capabilities: 0x196e
#	HT20/HT40
#	SM Power Save disabled
#	RX HT20 SGI
#	RX HT40 SGI
#	RX STBC 1-stream
#	Max AMSDU length: 7935 bytes
#	DSSS/CCK HT40
#ht_capab=[HT40+][HT40-][SHORT-GI-20][SHORT-GI-40][RX-STBC1][MAX-AMSDU-7935][DSSS_CCK-40]
# rtw88 rtl8812au
# ht_capab=[HT40+][HT40-][SHORT-GI-20][SHORT-GI-40][MAX-AMSDU-7935]

# IEEE 802.11ac (WiFi 5) configuration
ieee80211ac=1
# Channel width (0 = 40 MHz. 1 = 80 Mhz)
vht_oper_chwidth=1
# VHT center channel (chan + 6)
vht_oper_centr_freq_seg0_idx=155
#
# generic setting
#vht_capab=[SHORT-GI-80]
#
# mt7610u
#vht_capab=[SHORT-GI-80][MAX-A-MPDU-LEN-EXP3][RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN]
# mt7612u
#vht_capab=[RXLDPC][SHORT-GI-80][TX-STBC-2BY1][RX-STBC-1][MAX-A-MPDU-LEN-EXP3][RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN]
# mt7921au (VHT Cap. 339071b2)
#vht_capab=[MAX-MPDU-11454][RXLDPC][SHORT-GI-80][TX-STBC-2BY1][RX-STBC-1][SU-BEAMFORMEE][BF-ANTENNA-4][MAX-A-MPDU-LEN-EXP7][RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN]
#
# realtek chipsets (vendor driver)
# rtl8812au - rtl8812bu
#vht_capab=[MAX-MPDU-11454][SHORT-GI-80][TX-STBC-2BY1][RX-STBC-1][HTC-VHT][MAX-A-MPDU-LEN-EXP7]
# rtl8814au
#vht_capab=[MAX-MPDU-11454][RXLDPC][SHORT-GI-80][TX-STBC-2BY1][RX-STBC-1][HTC-VHT][MAX-A-MPDU-LEN-EXP7]
# rtl8811au
# vht_capab=[MAX-MPDU-11454][SHORT-GI-80][RX-STBC-1][HTC-VHT][MAX-A-MPDU-LEN-EXP7]
# rtl8811cu
vht_capab=[MAX-MPDU-11454][SHORT-GI-80][HTC-VHT][MAX-A-MPDU-LEN-EXP7][RX-STBC-1][SU-BEAMFORMEE][MU-BEAMFORMEE]
#
# Note: [TX-STBC-2BY1] may cause problems with some Realtek drivers
#
# rtw88 driver
# band 2: rtw88 rtl8811au rtl8811cu
# VHT Capabilities (0x03d07122):
# 	Max MPDU length: 11454
# 	Supported Channel Width: neither 160 nor 80+80
# 	short GI (80 MHz)
# 	SU Beamformee
# 	MU Beamformee
# 	+HTC-VHT
#vht_capab=[MAX-MPDU-11454][SHORT-GI-80][SU-BEAMFORMEE][MU-BEAMFORMEE][HTC-VHT]
# rtw88 rtl8812au
# vht_capab=[MAX-MPDU-11454][SHORT-GI-80][TX-STBC-2BY1][SU-BEAMFORMEE][HTC-VHT]

# end of hostapd-WiFi5.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment