我有一台 ubuntu 网关服务器,上面有 2 个网卡,一个用于互联网,一个用于局域网。我刚刚在无线设备上设置了无线接入点,hostapd
但客户端无法连接到它,日志中出现以下错误:
Dec 12 10:08:56 localhost hostapd: wlp6s0: STA 84:cf:bf:91:d8:35 IEEE 802.11: authenticated
Dec 12 10:08:56 localhost hostapd: wlp6s0: STA 84:cf:bf:91:d8:35 IEEE 802.11: associated (aid 1)
Dec 12 10:09:05 localhost hostapd: wlp6s0: STA 84:cf:bf:91:d8:35 IEEE 802.11: deauthenticated due to local deauth request
到目前为止,我已经设法通过猜测和在各个地方寻找单独的步骤来完成配置,因为我找不到任何涵盖 ubuntu、netplan
和 的操作指南hostapd
。
这是我的设置:
hostapd.conf:
adam@gondolin:~$ cat /etc/hostapd/hostapd.conf
interface=wlp6s0
driver=nl80211
bridge=br0
ssid=Anduin
hw_mode=g
channel=1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=secret123
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
网络计划:
adam@gondolin:~$ cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp5s0:
dhcp4: yes
dhcp6: yes
eno1:
addresses:
- fe80::10/128
- 192.168.0.3/24
dhcp4: no
dhcp6: no
wlp6s0:
dhcp4: no
dhcp6: no
答案1
仍然不清楚为什么会出现取消认证消息,但是我hostapd
通过在 netplan 中设置桥接解决了这个问题。
adam@gondolin:~$ cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp5s0:
dhcp4: yes
dhcp6: yes
eno1:
dhcp4: no
dhcp6: no
wlp6s0:
dhcp4: no
dhcp6: no
bridges:
br0:
interfaces:
- eno1
- wlp6s0
addresses:
- 192.168.0.3/24
nameservers:
addresses: [208.67.220.220,208.67.222.222]
adam@gondolin:~$