我正在使用hostapd创build一个接入点,我想知道是否有任何方法可以获得当前或最近关联尝试的输出。
理想情况下,我希望看到MAC ID和其他更低级别的信息。 我更感兴趣的是物理层面的监控,而不是DHCP。
在你的hostapd.conf中:
# 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 5 (32) = IAPP # 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
在消息中你应该看到这样的日志:
hostapd: wlan0: STA 00:0c:f1:11:57:4e IEEE 802.11: authentication OK (open system) hostapd: wlan0: STA 00:0c:f1:11:57:4e MLME: MLME-AUTHENTICATE.indication(00:0c:f1:11:57:4e, OPEN_SYSTEM) hostapd: wlan0: STA 00:0c:f1:11:57:4e MLME: MLME-DELETEKEYS.request(00:0c:f1:11:57:4e) hostapd: wlan0: STA 00:0c:f1:11:57:4e IEEE 802.11: authenticated hostapd: wlan0: STA 00:0c:f1:11:57:4e IEEE 802.11: association OK (aid 1) hostapd: wlan0: STA 00:0c:f1:11:57:4e IEEE 802.11: associated (aid 1) hostapd: wlan0: STA 00:0c:f1:11:57:4e MLME: MLME-ASSOCIATE.indication(00:0c:f1:11:57:4e) hostapd: wlan0: STA 00:0c:f1:11:57:4e MLME: MLME-DELETEKEYS.request(00:0c:f1:11:57:4e) hostapd: wlan0: STA 00:0c:f1:11:57:4e WPA: event 1 notification hostapd: wlan0: STA 00:0c:f1:11:57:4e WPA: start authentication hostapd: wlan0: STA 00:0c:f1:11:57:4e IEEE 802.1X: unauthorizing port hostapd: wlan0: STA 00:0c:f1:11:57:4e WPA: sending 1/4 msg of 4-Way Handshake hostapd: wlan0: STA 00:0c:f1:11:57:4e WPA: EAPOL-Key timeout hostapd: wlan0: STA 00:0c:f1:11:57:4e WPA: sending 1/4 msg of 4-Way Handshake
您可以启用控制接口 ,然后使用内置的hostapd_cli连接到其UNIX套接字并发出命令。
在hostapd.conf :
ctrl_interface=/var/run/hostapd # default path of the socket, can be changed if needed ctrl_interface_group=wifi # group that will own the socket, can be a name or GID