hostapd -hDisplays the help message with all available command-line options and syntax
A user-space daemon that turns a wireless card into an access point — used for test networks and rogue-AP assessments.
sudo apt install hostapdhostapd -hDisplays the help message with all available command-line options and syntax
hostapd -vPrints the current version of hostapd to verify installation and build details
hostapd hostapd.confStarts the access point in the foreground using a specific configuration file
Example
hostapd /etc/hostapd/hostapd.confhostapd -B hostapd.confStarts hostapd in daemon mode (background) to run as a service
Example
hostapd -B /etc/hostapd/hostapd.confhostapd -P /run/hostapd.pid -B hostapd.confRuns in background and writes the process ID to a specific file for service management
Example
hostapd -P /var/run/hostapd.pid -B hostapd.confhostapd -d hostapd.confStarts hostapd with verbose debugging enabled to show basic status and event messages
hostapd -dd hostapd.confEnables excessive debugging to view detailed state machine transitions and frame details
hostapd -t -d hostapd.confPrepends timestamps to all debug output for timeline analysis of connection events
hostapd -f /var/log/hostapd.log hostapd.confRedirects all log output to a specified file instead of standard output
hostapd -K -dd hostapd.confIncludes cryptographic key data in debug output (Warning: Unsafe for production, used for deep inspection)
hostapd -g /var/run/hostapd/global hostapd.confEnables the global control interface for external management tools like hostapd_cli
printf 'interface=wlan0\ndriver=nl80211\nssid=OpenLab\nhw_mode=g\nchannel=6\n' > hostapd.conf && hostapd hostapd.confCreates and runs a basic Open (unencrypted) 2.4GHz access point on channel 6
Example
Generate minimal open config and runprintf 'interface=wlan0\nbridge=br0\nssid=BridgedAP\nhw_mode=g\nchannel=1\n' > hostapd.conf && hostapd hostapd.confConfigures the AP to bridge traffic to a wired interface (br0) for network integration
Example
Generate bridged config and runprintf 'interface=wlan0\nssid=HiddenLab\nignore_broadcast_ssid=1\nhw_mode=g\nchannel=11\n' > hostapd.conf && hostapd hostapd.confCreates an access point with a hidden SSID by disabling beacon SSID broadcasting
Example
Generate hidden SSID config and runprintf 'interface=wlan0\nssid=WPA2-Test\nhw_mode=g\nchannel=6\nwpa=2\nwpa_passphrase=Password123\nwpa_key_mgmt=WPA-PSK\nwpa_pairwise=CCMP\n' > hostapd.conf && hostapd hostapd.confSets up a standard WPA2 Personal network using CCMP (AES) encryption
Example
Generate WPA2-PSK config and runprintf 'interface=wlan0\nssid=LegacyMix\nwpa=3\nwpa_passphrase=LegacyPass\nwpa_key_mgmt=WPA-PSK\nwpa_pairwise=TKIP CCMP\n' > hostapd.conf && hostapd hostapd.confEnables mixed WPA1/WPA2 mode allowing both TKIP and CCMP ciphers (Legacy support)
Example
Generate WPA1/WPA2 Mixed config and runprintf 'interface=wlan0\nssid=MacFilterAP\nmacaddr_acl=1\naccept_mac_file=hostapd.accept\n' > hostapd.conf && echo '00:11:22:33:44:55' > hostapd.accept && hostapd hostapd.confConfigures an Allow List (Whitelist) where only specified MAC addresses can associate
Example
Generate MAC Allow List config and runprintf 'interface=wlan0\nssid=DenyListAP\nmacaddr_acl=0\ndeny_mac_file=hostapd.deny\n' > hostapd.conf && echo 'aa:bb:cc:dd:ee:ff' > hostapd.deny && hostapd hostapd.confConfigures a Deny List (Blacklist) to explicitly block specific devices from connecting
Example
Generate MAC Deny List config and runprintf 'interface=wlan0\nssid=N-Mode-AP\nhw_mode=g\nchannel=6\nieee80211n=1\nht_capab=[HT40+]\n' > hostapd.conf && hostapd hostapd.confEnables 802.11n High Throughput mode with 40MHz channel width
Example
Generate 802.11n HT40 config and runprintf 'interface=wlan0\nssid=AC-Mode-AP\nhw_mode=a\nchannel=36\nieee80211n=1\nieee80211ac=1\nvht_oper_chwidth=1\nvht_oper_centr_freq_seg0_idx=42\n' > hostapd.conf && hostapd hostapd.confEnables 802.11ac Very High Throughput mode on 5GHz with 80MHz channel width
Example
Generate 802.11ac VHT80 config and runprintf 'interface=wlan0\nssid=AX-WiFi6\nhw_mode=a\nchannel=36\nieee80211n=1\nieee80211ac=1\nieee80211ax=1\nhe_su_beamformer=1\nhe_su_beamformee=1\n' > hostapd.conf && hostapd hostapd.confEnables 802.11ax (Wi-Fi 6) High Efficiency features including beamforming support
Example
Generate 802.11ax HE config and runprintf 'interface=wlan0\nssid=RegDomainTest\ncountry_code=US\nieee80211d=1\n' > hostapd.conf && hostapd hostapd.confAdvertises the US country code (802.11d) to clients to enforce regulatory domain constraints
Example
Generate Country Code config and runprintf 'interface=wlan0\nssid=WPA3-SAE\nhw_mode=g\nchannel=6\nwpa=2\nwpa_passphrase=SecurePass123\nwpa_key_mgmt=SAE\nieee80211w=2\n' > hostapd.conf && hostapd hostapd.confConfigures a pure WPA3 network using SAE authentication and mandatory Management Frame Protection (MFP)
Example
Generate WPA3-SAE Only config and runprintf 'interface=wlan0\nssid=WPA3-Transition\nhw_mode=g\nchannel=6\nwpa=2\nwpa_passphrase=TransitionPass\nwpa_key_mgmt=WPA-PSK SAE\nieee80211w=1\n' > hostapd.conf && hostapd hostapd.confAllows both WPA3-SAE and WPA2-PSK clients to connect with optional MFP
Example
Generate WPA3/WPA2 Transition config and runprintf 'interface=wlan0\nssid=OWE-Net\nhw_mode=g\nchannel=6\nwpa=2\nwpa_key_mgmt=OWE\nieee80211w=2\n' > hostapd.conf && hostapd hostapd.confSets up Opportunistic Wireless Encryption (Enhanced Open) for encrypted unauthenticated connections
Example
Generate OWE config and runprintf 'interface=wlan0\nssid=Enterprise-AP\nwpa=2\nwpa_key_mgmt=WPA-EAP\nieee8021x=1\nauth_server_addr=127.0.0.1\nauth_server_port=1812\nauth_server_shared_secret=radiusSecret\n' > hostapd.conf && hostapd hostapd.confConfigures WPA2-Enterprise requiring an external RADIUS server for 802.1X authentication
Example
Generate WPA2-Enterprise config and runprintf 'interface=wlan0\nssid=LocalEAP\nieee8021x=1\neap_server=1\neap_user_file=hostapd.eap_user\nca_cert=ca.pem\nserver_cert=server.pem\nprivate_key=server.key\n' > hostapd.conf && hostapd hostapd.confUses hostapd's built-in EAP server to handle 802.1X authentication without an external RADIUS
Example
Generate Internal EAP Server config and runprintf 'interface=wlan0\nssid=AcctAP\nwpa=2\nwpa_key_mgmt=WPA-EAP\nieee8021x=1\nacct_server_addr=127.0.0.1\nacct_server_port=1813\nacct_server_shared_secret=radiusSecret\n' > hostapd.conf && hostapd hostapd.confEnables RADIUS accounting to report session duration and data usage to an accounting server
Example
Generate RADIUS Accounting config and runprintf 'interface=wlan0\nssid=IsolatedGuests\nap_isolate=1\nhw_mode=g\nchannel=6\n' > hostapd.conf && hostapd hostapd.confPrevents associated wireless clients from communicating directly with each other (Client Isolation)
Example
Generate AP Isolation config and runprintf 'interface=wlan0\nssid=WPS-Enabled\nwps_state=2\neap_server=1\nconfig_methods=label display push_button keypad\n' > hostapd.conf && hostapd hostapd.confEnables Wi-Fi Protected Setup (WPS) with Push Button and PIN methods (insecure but useful for testing)
Example
Generate WPS config and runprintf 'interface=wlan0\nssid=PrimaryNet\nbss=wlan0_1\nssid=GuestNet\nwpa=2\nwpa_passphrase=GuestPass\n' > hostapd.conf && hostapd hostapd.confCreates multiple virtual access points (SSIDs) on a single physical wireless interface
Example
Generate Multi-BSSID config and runprintf 'interface=wlan0\nssid=FastBeacon\nbeacon_int=15\nhw_mode=g\nchannel=6\n' > hostapd.conf && hostapd hostapd.confReduces the beacon interval to 15 TU (approx 15ms) for aggressive network advertising
Example
Generate Custom Beacon Interval config and runhostapd_cli -i wlan0 karma_enableEnables Karma mode (if using a patched hostapd-mana) to respond to all probe requests
printf 'interface=wlan0\nssid=CorporateWifi\nwpa=2\nwpa_passphrase=password123\nlogger_stdout=-1\nlogger_stdout_level=0\n' > rogue.conf && hostapd -K rogue.confSets up a Rogue AP mimicking a corporate network and logging full details including keys for interception
Example
Generate Rogue AP config and runprintf 'interface=wlan0\nssid=MFP-Strict\nwpa=2\nieee80211w=2\n' > hostapd.conf && hostapd hostapd.confEnforces Management Frame Protection (PMF) to block deauthentication attacks
Example
Generate Strict MFP config and runprintf 'interface=wlan0\nssid=VLAN-AP\ndynamic_vlan=1\nvlan_file=hostapd.vlan\n' > hostapd.conf && hostapd hostapd.confConfigures dynamic VLAN assignment based on RADIUS attributes or station MAC addresses
Example
Generate Dynamic VLAN config and runhostapd_cli -p /var/run/hostapd pingPings the running hostapd daemon to verify the control interface is responsive
Example
hostapd_cli pinghostapd_cli all_staLists all currently associated stations (clients) along with their statistics
hostapd_cli deauthenticate 00:11:22:33:44:55Forces a specific client to disconnect from the access point immediately
Example
hostapd_cli deauthenticate <MAC>hostapd_cli disassociate 00:11:22:33:44:55Disassociates a client, effectively kicking them off but allowing immediate reconnection attempts
Example
hostapd_cli disassociate <MAC>hostapd_cli set deny_mac_file hostapd.new_denyDynamically updates the path to the MAC deny list file without restarting the AP
Example
hostapd_cli set deny_mac_file /tmp/new_denyhostapd_cli reloadReloads the configuration file to apply changes like updated MAC lists
hostapd_cli wps_pbcActivates WPS Push Button Configuration mode for the next two minutes
hostapd_cli wps_pin any 12345670Registers a specific WPS PIN to allow a client to connect using that PIN
hostapd_cli get_configRetrieves and displays the current runtime configuration details of the AP
hostapd_cli log_level DEBUGDynamically changes the logging verbosity to DEBUG while the AP is running
hostapd -t -K -f /tmp/hostapd_debug.log hostapd.confRuns hostapd logging keys and timestamps to a file for offline packet decryption analysis
Example
hostapd -t -K -f /tmp/debug.log hostapd.confhostapd_cli sta 00:11:22:33:44:55Shows detailed statistics for a single connected client including signal strength and packet counts
Example
hostapd_cli sta <MAC>printf 'interface=wlan0\nssid=PasspointAP\ninterworking=1\naccess_network_type=0\ninternet=1\n' > hostapd.conf && hostapd hostapd.confEnables Interworking bits to advertise Hotspot 2.0 capabilities to compatible clients
Example
Generate Basic Passpoint config and runhostapd_cli chan_switch 5 5180Initiates a Channel Switch Announcement (CSA) moving the AP to a new frequency after 5 beacons
Example
hostapd_cli chan_switch <cs_count> <freq>printf 'interface=wlan0\nssid=FairAP\nwsmm_ac_vo_aifs=2\nwsmm_ac_vi_aifs=2\n' > hostapd.conf && hostapd hostapd.confTunes WMM parameters (AIFS) to prioritize Voice/Video traffic or enforce airtime fairness
Example
Generate WMM AIFS config and runprintf 'interface=wlan0\nssid=ForensicHoneypot\nwpa=2\nwpa_passphrase=honeyhoney\nlogger_syslog=1\nlogger_syslog_level=0\n' > hostapd.conf && hostapd hostapd.confDeploys a honeypot AP that logs all events to syslog for SIEM ingestion and incident simulation
Example
Generate Honeypot config and runprintf 'interface=wlan0\nssid=DFS-Test\nhw_mode=a\nchannel=52\nieee80211h=1\n' > hostapd.conf && hostapd hostapd.confConfigures the AP on a DFS channel (52) requiring radar detection (802.11h) enabled
Example
Generate DFS Channel config and runprintf 'interface=wlan0\nssid=RoamingAP\nwpa=2\nwpa_passphrase=roamingpass\nieee80211r=1\nmobility_domain=a1b2\n' > hostapd.conf && hostapd hostapd.confEnables Fast Transition (FT) to allow clients to roam quickly between APs in the same mobility domain
Example
Generate FT 802.11r config and runprintf 'interface=wlan0\nssid=ProtMode\nhw_mode=g\nchannel=6\nrts_threshold=2347\nfragm_threshold=2346\n' > hostapd.conf && hostapd hostapd.confAdjusts RTS and Fragmentation thresholds to manage collisions in noisy environments
Example
Generate RTS/Frag config and runprintf 'interface=wlan0\nssid=LoadBalanceAP\nmax_num_sta=10\n' > hostapd.conf && hostapd hostapd.confLimits the maximum number of associated stations to 10 to force load balancing to other APs
Example
Generate Max Clients config and runhostapd -B hostapd.conf && sleep 5 && hostapd_cli ping && echo 'AP Started'Automation sequence to start hostapd, wait for initialization, and verify responsiveness
Example
hostapd -B conf && check statuskillall hostapdStops all running hostapd instances immediately
rm -f /var/run/hostapd/*Cleans up stale control interface sockets to prevent binding errors on restart
ip link set wlan0 down && ip addr flush dev wlan0Resets the wireless interface state to default after stopping the access point
Example
ip link set wlan0 downThe modern nl80211 tool for configuring Linux wireless devices: scan, set channels, switch modes and inspect capabilities.
Puts wireless interfaces into monitor mode and stops processes that would interfere with packet capture.
The legacy wireless-extensions tool for viewing and setting interface parameters like mode, channel and power. Prefer iw on modern systems.