📄 hostapd.conf
字号:
#wpa_psk=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef#wpa_passphrase=secret passphrase# Optionally, WPA PSKs can be read from a separate text file (containing list# of (PSK,MAC address) pairs. This allows more than one PSK to be configured.# Use absolute path name to make sure that the files can be read on SIGHUP# configuration reloads.#wpa_psk_file=/etc/hostapd.wpa_psk# Set of accepted key management algorithms (WPA-PSK, WPA-EAP, or both). The# entries are separated with a space. WPA-PSK-SHA256 and WPA-EAP-SHA256 can be# added to enable SHA256-based stronger algorithms.# (dot11RSNAConfigAuthenticationSuitesTable)#wpa_key_mgmt=WPA-PSK WPA-EAP# Set of accepted cipher suites (encryption algorithms) for pairwise keys# (unicast packets). This is a space separated list of algorithms:# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]# Group cipher suite (encryption algorithm for broadcast and multicast frames)# is automatically selected based on this configuration. If only CCMP is# allowed as the pairwise cipher, group cipher will also be CCMP. Otherwise,# TKIP will be used as the group cipher.# (dot11RSNAConfigPairwiseCiphersTable)# Pairwise cipher for WPA (v1) (default: TKIP)#wpa_pairwise=TKIP CCMP# Pairwise cipher for RSN/WPA2 (default: use wpa_pairwise value)#rsn_pairwise=CCMP# Time interval for rekeying GTK (broadcast/multicast encryption keys) in# seconds. (dot11RSNAConfigGroupRekeyTime)#wpa_group_rekey=600# Rekey GTK when any STA that possesses the current GTK is leaving the BSS.# (dot11RSNAConfigGroupRekeyStrict)#wpa_strict_rekey=1# Time interval for rekeying GMK (master key used internally to generate GTKs# (in seconds).#wpa_gmk_rekey=86400# Maximum lifetime for PTK in seconds. This can be used to enforce rekeying of# PTK to mitigate some attacks against TKIP deficiencies.#wpa_ptk_rekey=600# Enable IEEE 802.11i/RSN/WPA2 pre-authentication. This is used to speed up# roaming be pre-authenticating IEEE 802.1X/EAP part of the full RSN# authentication and key handshake before actually associating with a new AP.# (dot11RSNAPreauthenticationEnabled)#rsn_preauth=1## Space separated list of interfaces from which pre-authentication frames are# accepted (e.g., 'eth0' or 'eth0 wlan0wds0'. This list should include all# interface that are used for connections to other APs. This could include# wired interfaces and WDS links. The normal wireless data interface towards# associated stations (e.g., wlan0) should not be added, since# pre-authentication is only used with APs other than the currently associated# one.#rsn_preauth_interfaces=eth0# peerkey: Whether PeerKey negotiation for direct links (IEEE 802.11e) is# allowed. This is only used with RSN/WPA2.# 0 = disabled (default)# 1 = enabled#peerkey=1# ieee80211w: Whether management frame protection (MFP) is enabled# 0 = disabled (default)# 1 = optional# 2 = required#ieee80211w=0# Association SA Query maximum timeout (in TU = 1.024 ms; for MFP)# (maximum time to wait for a SA Query response)# dot11AssociationSAQueryMaximumTimeout, 1...4294967295#assoc_sa_query_max_timeout=1000# Association SA Query retry timeout (in TU = 1.024 ms; for MFP)# (time between two subsequent SA Query requests)# dot11AssociationSAQueryRetryTimeout, 1...4294967295#assoc_sa_query_retry_timeout=201# okc: Opportunistic Key Caching (aka Proactive Key Caching)# Allow PMK cache to be shared opportunistically among configured interfaces# and BSSes (i.e., all configurations within a single hostapd process).# 0 = disabled (default)# 1 = enabled#okc=1##### IEEE 802.11r configuration ############################################### Mobility Domain identifier (dot11FTMobilityDomainID, MDID)# MDID is used to indicate a group of APs (within an ESS, i.e., sharing the# same SSID) between which a STA can use Fast BSS Transition.# 2-octet identifier as a hex string.#mobility_domain=a1b2# PMK-R0 Key Holder identifier (dot11FTR0KeyHolderID)# 1 to 48 octet identifier.# This is configured with nas_identifier (see RADIUS client section above).# Default lifetime of the PMK-RO in minutes; range 1..65535# (dot11FTR0KeyLifetime)#r0_key_lifetime=10000# PMK-R1 Key Holder identifier (dot11FTR1KeyHolderID)# 6-octet identifier as a hex string.#r1_key_holder=000102030405# Reassociation deadline in time units (TUs / 1.024 ms; range 1000..65535)# (dot11FTReassociationDeadline)#reassociation_deadline=1000# List of R0KHs in the same Mobility Domain# format: <MAC address> <NAS Identifier> <128-bit key as hex string># This list is used to map R0KH-ID (NAS Identifier) to a destination MAC# address when requesting PMK-R1 key from the R0KH that the STA used during the# Initial Mobility Domain Association.#r0kh=02:01:02:03:04:05 r0kh-1.example.com 000102030405060708090a0b0c0d0e0f#r0kh=02:01:02:03:04:06 r0kh-2.example.com 00112233445566778899aabbccddeeff# And so on.. One line per R0KH.# List of R1KHs in the same Mobility Domain# format: <MAC address> <R0KH-ID> <128-bit key as hex string># This list is used to map R1KH-ID to a destination MAC address when sending# PMK-R1 key from the R0KH. This is also the list of authorized R1KHs in the MD# that can request PMK-R1 keys.#r1kh=02:01:02:03:04:05 02:11:22:33:44:55 000102030405060708090a0b0c0d0e0f#r1kh=02:01:02:03:04:06 02:11:22:33:44:66 00112233445566778899aabbccddeeff# And so on.. One line per R1KH.# Whether PMK-R1 push is enabled at R0KH# 0 = do not push PMK-R1 to all configured R1KHs (default)# 1 = push PMK-R1 to all configured R1KHs whenever a new PMK-R0 is derived#pmk_r1_push=1##### Passive scanning ######################################################### Scan different channels every N seconds. 0 = disable passive scanning.#passive_scan_interval=60# Listen N usecs on each channel when doing passive scanning.# This value plus the time needed for changing channels should be less than# 32 milliseconds (i.e. 32000 usec) to avoid interruptions to normal# operations. Time needed for channel changing varies based on the used wlan# hardware.# default: disabled (0)#passive_scan_listen=10000# Passive scanning mode:# 0 = scan all supported modes (802.11a/b/g/Turbo) (default)# 1 = scan only the mode that is currently used for normal operations#passive_scan_mode=1# Maximum number of entries kept in AP table (either for passive scanning or# for detecting Overlapping Legacy BSS Condition). The oldest entry will be# removed when adding a new entry that would make the list grow over this# limit. Note! Wi-Fi certification for IEEE 802.11g requires that OLBC is# enabled, so this field should not be set to 0 when using IEEE 802.11g.# default: 255#ap_table_max_size=255# Number of seconds of no frames received after which entries may be deleted# from the AP table. Since passive scanning is not usually performed frequently# this should not be set to very small value. In addition, there is no# guarantee that every scan cycle will receive beacon frames from the# neighboring APs.# default: 60#ap_table_expiration_time=3600##### Wi-Fi Protected Setup (WPS) ############################################## WPS state# 0 = WPS disabled (default)# 1 = WPS enabled, not configured# 2 = WPS enabled, configured#wps_state=2# AP can be configured into a locked state where new WPS Registrar are not# accepted, but previously authorized Registrars (including the internal one)# can continue to add new Enrollees.#ap_setup_locked=1# Universally Unique IDentifier (UUID; see RFC 4122) of the device# This value is used as the UUID for the internal WPS Registrar. If the AP# is also using UPnP, this value should be set to the device's UPnP UUID.# If not configured, UUID will be generated based on the local MAC address.#uuid=12345678-9abc-def0-1234-56789abcdef0# Note: If wpa_psk_file is set, WPS is used to generate random, per-device PSKs# that will be appended to the wpa_psk_file. If wpa_psk_file is not set, the# default PSK (wpa_psk/wpa_passphrase) will be delivered to Enrollees. Use of# per-device PSKs is recommended as the more secure option (i.e., make sure to# set wpa_psk_file when using WPS with WPA-PSK).# When an Enrollee requests access to the network with PIN method, the Enrollee# PIN will need to be entered for the Registrar. PIN request notifications are# sent to hostapd ctrl_iface monitor. In addition, they can be written to a# text file that could be used, e.g., to populate the AP administration UI with# pending PIN requests. If the following variable is set, the PIN requests will# be written to the configured file.#wps_pin_requests=/var/run/hostapd_wps_pin_requests# Device Name# User-friendly description of device; up to 32 octets encoded in UTF-8#device_name=Wireless AP# Manufacturer# The manufacturer of the device (up to 64 ASCII characters)#manufacturer=Company# Model Name# Model of the device (up to 32 ASCII characters)#model_name=WAP# Model Number# Additional device description (up to 32 ASCII characters)#model_number=123# Serial Number# Serial number of the device (up to 32 characters)#serial_number=12345# Primary Device Type# Used format: <categ>-<OUI>-<subcateg># categ = Category as an integer value# OUI = OUI and type octet as a 4-octet hex-encoded value; 0050F204 for# default WPS OUI# subcateg = OUI-specific Sub Category as an integer value# Examples:# 1-0050F204-1 (Computer / PC)# 1-0050F204-2 (Computer / Server)# 5-0050F204-1 (Storage / NAS)# 6-0050F204-1 (Network Infrastructure / AP)#device_type=6-0050F204-1# OS Version# 4-octet operating system version number (hex string)#os_version=01020300# Config Methods# List of the supported configuration methods#config_methods=label display push_button keypad# Access point PIN for initial configuration and adding Registrars# If not set, hostapd will not allow external WPS Registrars to control the# access point.#ap_pin=12345670# Skip building of automatic WPS credential# This can be used to allow the automatically generated Credential attribute to# be replaced with pre-configured Credential(s).#skip_cred_build=1# Additional Credential attribute(s)# This option can be used to add pre-configured Credential attributes into M8# message when acting as a Registrar. If skip_cred_build=1, this data will also# be able to override the Credential attribute that would have otherwise been# automatically generated based on network configuration. This configuration# option points to an external file that much contain the WPS Credential# attribute(s) as binary data.#extra_cred=hostapd.cred# Credential processing# 0 = process received credentials internally (default)# 1 = do not process received credentials; just pass them over ctrl_iface to# external program(s)# 2 = process received credentials internally and pass them over ctrl_iface# to external program(s)# Note: With wps_cred_processing=1, skip_cred_build should be set to 1 and# extra_cred be used to provide the Credential data for Enrollees.## wps_cred_processing=1 will disabled automatic updates of hostapd.conf file# both for Credential processing and for marking AP Setup Locked based on# validation failures of AP PIN. An external program is responsible on updating# the configuration appropriately in this case.#wps_cred_processing=0# AP Settings Attributes for M7# By default, hostapd generates the AP Settings Attributes for M7 based on the# current configuration. It is possible to override this by providing a file# with pre-configured attributes. This is similar to extra_cred file format,# but the AP Settings attributes are not encapsulated in a Credential# attribute.#ap_settings=hostapd.ap_settings# WPS UPnP interface# If set, support for external Registrars is enabled.#upnp_iface=br0# Friendly Name (required for UPnP)# Short description for end use. Should be less than 64 characters.#friendly_name=WPS Access Point# Manufacturer URL (optional for UPnP)#manufacturer_url=http://www.example.com/# Model Description (recommended for UPnP)# Long description for end user. Should be less than 128 characters.#model_description=Wireless Access Point# Model URL (optional for UPnP)#model_url=http://www.example.com/model/# Universal Product Code (optional for UPnP)# 12-digit, all-numeric code that identifies the consumer package.#upc=123456789012##### Multiple BSSID support #################################################### Above configuration is using the default interface (wlan#, or multi-SSID VLAN# interfaces). Other BSSIDs can be added by using separator 'bss' with# default interface name to be allocated for the data packets of the new BSS.## hostapd will generate BSSID mask based on the BSSIDs that are# configured. hostapd will verify that dev_addr & MASK == dev_addr. If this is# not the case, the MAC address of the radio must be changed before starting# hostapd (ifconfig wlan0 hw ether <MAC addr>).## BSSIDs are assigned in order to each BSS, unless an explicit BSSID is# specified using the 'bssid' parameter.# If an explicit BSSID is specified, it must be chosen such that it:# - results in a valid MASK that covers it and the dev_addr# - is not the same as the MAC address of the radio# - is not the same as any other explicitly specified BSSID## Please note that hostapd uses some of the values configured for the first BSS# as the defaults for the following BSSes. However, it is recommended that all# BSSes include explicit configuration of all relevant configuration items.##bss=wlan0_0#ssid=test2# most of the above items can be used here (apart from radio interface specific# items, like channel)#bss=wlan0_1#bssid=00:13:10:95:fe:0b# ...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -