我有带有 Wi-Fi 接入点 Hostapd + isc-dhcp-server 的 Ubuntu 22.04,每次我连接客户端时它都会在 2 秒后自动断开连接。
以下是 的内容/etc/hostapd/hostapd.conf
:
interface=wlp3s0
hw_mode=g
channel=10
ieee80211d=1
country_code=FR
ieee80211n=1
wmm_enabled=1
ssid=somename
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=somepassword
以及/etc/dhcp/dhcpd.conf
:
option domain-name-servers 8.8.8.8, 8.8.4.4;
default-lease-time 600;
max-lease-time 7200;
authoritative;
subnet 10.10.10.0 netmask 255.255.255.0 {
interface wlp3s0;
range 10.10.10.100 10.10.10.125;
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
}
tail -f /var/log/syslog
(dummyuser)的输出:
Jan 9 00:19:15 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 IEEE 802.11: authenticated
Jan 9 00:19:15 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 IEEE 802.11: associated (aid 1)
Jan 9 00:19:15 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 RADIUS: starting accounting session 9B7BD58F3E6D8283
Jan 9 00:19:15 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 WPA: pairwise key handshake completed (RSN)
Jan 9 00:19:15 user-Default-string dhcpd[69049]: DHCPREQUEST for 10.10.10.102 from b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:16 user-Default-string dhcpd[69049]: DHCPACK on 10.10.10.102 to b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:16 user-Default-string dhcpd[69049]: reuse_lease: lease age 1 (secs) under 25% threshold, reply with unaltered, existing lease for 10.10.10.102
Jan 9 00:19:16 user-Default-string dhcpd[69049]: DHCPREQUEST for 10.10.10.102 from b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:16 user-Default-string dhcpd[69049]: DHCPACK on 10.10.10.102 to b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:20 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 IEEE 802.11: authenticated
Jan 9 00:19:20 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 IEEE 802.11: associated (aid 1)
Jan 9 00:19:20 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 RADIUS: starting accounting session 73F73824FEAE4501
Jan 9 00:19:20 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 WPA: pairwise key handshake completed (RSN)
Jan 9 00:19:20 user-Default-string dhcpd[69049]: reuse_lease: lease age 5 (secs) under 25% threshold, reply with unaltered, existing lease for 10.10.10.102
Jan 9 00:19:20 user-Default-string dhcpd[69049]: DHCPREQUEST for 10.10.10.102 from b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:20 user-Default-string dhcpd[69049]: DHCPACK on 10.10.10.102 to b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:20 user-Default-string dhcpd[69049]: reuse_lease: lease age 5 (secs) under 25% threshold, reply with unaltered, existing lease for 10.10.10.102
Jan 9 00:19:20 user-Default-string dhcpd[69049]: DHCPREQUEST for 10.10.10.102 from b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:20 user-Default-string dhcpd[69049]: DHCPACK on 10.10.10.102 to b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:21 user-Default-string wpa_supplicant[772]: wlp3s0: CTRL-EVENT-SCAN-FAILED ret=-95
Jan 9 00:19:25 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 IEEE 802.11: authenticated
Jan 9 00:19:25 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 IEEE 802.11: associated (aid 1)
Jan 9 00:19:25 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 RADIUS: starting accounting session 316751CEC6B74E1B
Jan 9 00:19:25 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 WPA: pairwise key handshake completed (RSN)
Jan 9 00:19:25 user-Default-string dhcpd[69049]: reuse_lease: lease age 10 (secs) under 25% threshold, reply with unaltered, existing lease for 10.10.10.102
Jan 9 00:19:25 user-Default-string dhcpd[69049]: DHCPREQUEST for 10.10.10.102 from b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:25 user-Default-string dhcpd[69049]: DHCPACK on 10.10.10.102 to b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:25 user-Default-string dhcpd[69049]: reuse_lease: lease age 10 (secs) under 25% threshold, reply with unaltered, existing lease for 10.10.10.102
Jan 9 00:19:25 user-Default-string dhcpd[69049]: DHCPREQUEST for 10.10.10.102 from b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:25 user-Default-string dhcpd[69049]: DHCPACK on 10.10.10.102 to b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:30 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 IEEE 802.11: did not acknowledge authentication response
Jan 9 00:19:42 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 IEEE 802.11: authenticated
Jan 9 00:19:42 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 IEEE 802.11: associated (aid 1)
Jan 9 00:19:42 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 RADIUS: starting accounting session 0CAAFD57300A938A
Jan 9 00:19:42 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 WPA: pairwise key handshake completed (RSN)
Jan 9 00:19:42 user-Default-string dhcpd[69049]: reuse_lease: lease age 27 (secs) under 25% threshold, reply with unaltered, existing lease for 10.10.10.102
Jan 9 00:19:42 user-Default-string dhcpd[69049]: DHCPREQUEST for 10.10.10.102 from b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:42 user-Default-string dhcpd[69049]: DHCPACK on 10.10.10.102 to b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:42 user-Default-string dhcpd[69049]: reuse_lease: lease age 27 (secs) under 25% threshold, reply with unaltered, existing lease for 10.10.10.102
Jan 9 00:19:42 user-Default-string dhcpd[69049]: DHCPREQUEST for 10.10.10.102 from b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:42 user-Default-string dhcpd[69049]: DHCPACK on 10.10.10.102 to b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:47 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 IEEE 802.11: authenticated
Jan 9 00:19:47 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 IEEE 802.11: associated (aid 1)
Jan 9 00:19:47 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 RADIUS: starting accounting session 8835AC9D55825E6F
Jan 9 00:19:47 user-Default-string hostapd: wlp3s0: STA b2:8a:00:11:22:33 WPA: pairwise key handshake completed (RSN)
Jan 9 00:19:47 user-Default-string dhcpd[69049]: reuse_lease: lease age 32 (secs) under 25% threshold, reply with unaltered, existing lease for 10.10.10.102
Jan 9 00:19:47 user-Default-string dhcpd[69049]: DHCPREQUEST for 10.10.10.102 from b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:47 user-Default-string dhcpd[69049]: DHCPACK on 10.10.10.102 to b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:47 user-Default-string dhcpd[69049]: reuse_lease: lease age 32 (secs) under 25% threshold, reply with unaltered, existing lease for 10.10.10.102
Jan 9 00:19:47 user-Default-string dhcpd[69049]: DHCPREQUEST for 10.10.10.102 from b2:8a:00:11:22:33 (OnePlus) via wlp3s0
Jan 9 00:19:47 user-Default-string dhcpd[69049]: DHCPACK on 10.10.10.102 to b2:8a:00:11:22:33 (OnePlus) via wlp3s0
下列行也(总是)出现在日志中:
systemd[776074]: snap.snapd-desktop-integration.snapd-desktop-integration.service: Scheduled restart job, restart counter is at 6.
systemd[776074]: Stopped Service for snap application snapd-desktop-integration.snapd-desktop-integration.
systemd[776074]: Started Service for snap application snapd-desktop-integration.snapd-desktop-integration.
snapd-desktop-i[776798]: Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.
答案1
问题解决了。
我已将网关更改为 DHCP 服务器同一范围内的网关,客户端不再断开连接。
答案已从此处移至楼主的问题。