LinuxCommandLibrary

hostapd

Create wireless access point

TLDR

Start an access point

$ sudo hostapd [path/to/hostapd.conf]
copy

Start an access point, forking into the background
$ sudo hostapd -B [path/to/hostapd.conf]
copy

SYNOPSIS

hostapd [-BdfKknptv] [-P<pidfile>] [-g<global_ctrl>] [-G<ctrl_group>] [-f<logfile>] configfile

PARAMETERS

-B
    Run daemon in background (default if no console output).

-d
    Debug to stdout/stderr. Repeatable: -dd more, -ddd maximum verbosity.

-f <logfile>
    Log to specified file instead of stdout/syslog.

-K
    Include keys (passwords) in debug output.

-k
    Include configuration context in debug output.

-n
    Do not daemonize, even with -B (for debugging).

-p
    Ping disconnected stations.

-P <pidfile>
    Write process ID to file.

-g <path>
    Global control interface path.

-G <group>
    Control interface access group.

-t
    Include timestamps in some debug messages.

-v
    Show hostapd version.

DESCRIPTION

hostapd is a user-space daemon for implementing IEEE 802.11 access points and authentication servers on Linux. It supports host-based IEEE 802.1X Authenticator, WPA/WPA2/WPA3, EAP, RADIUS, and accounting. Designed to turn a compatible wireless interface into a full-featured Wi-Fi access point (AP), it handles client associations, encryption, authentication, and roaming.

Key capabilities include multiple BSS support on one radio, open/WEP/WPA-PSK/WPA-EAP modes, driver backends like nl80211, hostap, madwifi, and more. It requires a configuration file specifying interface, SSID, channel, security, and RADIUS details. hostapd binds to the interface, sets AP mode, beacons SSID, and manages clients.

Widely used in OpenWRT routers, embedded systems, and testing, it's part of the hostapd/wpa_supplicant project. Runtime control via control interface and hostapd_cli. Requires kernel support (cfg80211/mac80211) and hardware AP mode.

CAVEATS

Requires root privileges and wireless hardware/driver supporting AP mode (e.g., nl80211). Configuration file mandatory. May conflict with NetworkManager. Debug levels increase output significantly.

CONTROL INTERFACE

Enables runtime commands via Unix socket; use hostapd_cli for status, reload, disconnect.

DRIVERS

Primary: nl80211 (cfg80211). Others: hostap, bsd, madwifi. Check with hostapd -v.

HISTORY

Created by Jouni Malinen in 2002 for Intersil Host AP (Prism2/3) driver project. Evolved into multi-driver support via nl80211; active development adds WPA3, HE (Wi-Fi 6). Maintained in hostapd/wpa_supplicant repo.

SEE ALSO

hostapd_cli(1), wpa_supplicant(8), hostapd.conf(5), iw(8), iwconfig(8)

Copied to clipboard