AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题

问题[hostapd](unix)

Martin Hope
elbarna
Asked: 2023-09-27 09:43:24 +0800 CST

Hostapd快速断开连接

  • 5

情况就是这样。我在 Slackware 15 上设置了一个 hostapd 服务器,我使用这个适配器作为服务器,客户端也使用类似的适配器。

我对 hostapd 使用此配置

interface=wlan1
bridge=br0
driver=nl80211
ssid=mysid
hw_mode=a
channel=36
ieee80211d=1
ieee80211n=1
ieee80211ac=1
wmm_enabled=1
macaddr_acl=1
accept_mac_file=/etc/hostapd/hostapd.accept
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=mysid
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
country_code=IT

#HT
require_ht=1
require_vht=1
ht_capab=[MAX-AMSDU-7935][HT40+][SHORT-GI-20][SHORT-GI-40]

我启动了 hostapd,速度似乎不错

在服务器 iwconfig 报告上:

wlan1     IEEE 802.11AC  ESSID:"mysid"  Nickname:"WIFI@RTL88X2BU"
          Mode:Master  Frequency:5.18 GHz  Access Point: *******   
          Bit Rate:867 Mb/s   Sensitivity:0/0  
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=1/100  Signal level=1/100  Noise level=0/100
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

在客户端 iwconfig 报告上

wlan1     IEEE 802.11AC  ESSID:"mysid"  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency:5.18 GHz  Access Point: *******
          Bit Rate:434 Mb/s   Sensitivity:0/0  
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=100/100  Signal level=53/100  Noise level=0/100
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

问题是..使用两到五分钟后,客户端与 AP 断开连接并且无法重新连接,我必须重新启动 hostapd(原文如此!)。

内核是6.5.3,这是驱动程序。

我已经尝试过这些解决方案

a) 删除 ht_capab=[MAX-AMSDU-7935][HT40+][SHORT-GI-20][SHORT-GI-40],hostapd 会变慢至 173mb,问题仍然存在。

b) 使用网络管理器或 ip 命令配置网桥,但是同一件事,实际上我使用 brctl 来配置它。

这是来自 hostapd 的详细日志。

+

今天出现一些新错误

1695839108.387288: nl80211: set_key failed; err=-100 Network is down
RSN: PTK removal from the driver failed
wlan1: AP-STA-POSSIBLE-PSK-MISMATCH 
hostapd
  • 1 个回答
  • 42 Views
Martin Hope
elbarna
Asked: 2022-07-08 15:48:24 +0800 CST

hostapd:我只想要 wpa3..但启用 WEP!

  • 0

我只为 wpa3 身份验证启动 hostapd。

interface=wlan0
bridge=br0
driver=nl80211
ssid=mysid
hw_mode=g
channel=6
wpa=2
wpa_passphrase=iforgotit
wpa_key_mgmt=SAE
rsn_pairwise=CCMP

但是当我进行扫描时

nmcli 设备 wifi 列出它报告...WEP!

nmcli device wifi list 
IN-USE  BSSID              SSID         MODE   CHAN  RATE        SIGNAL  BARS  SECURITY  
        E****************  Mysid        Infra  6     65 Mbit/s   97      ▂▄▆█  WEP  

为什么?如何禁用wep?

编辑1:我添加了这个

auth_algs=1

但不工作,仍在哭泣

hostapd wpa
  • 1 个回答
  • 61 Views
Martin Hope
vendetta
Asked: 2019-12-05 13:26:54 +0800 CST

hostapd 客户端没有获得 ipv4 地址

  • 1

我正在尝试将 raspberrypi 4 设置为 wifi 接入点。按照官方文档,我设法桥接了我的 eth0 接口并设置了 hostapd。与文档相比,网桥 IP 由网络上现有的 DHCP 服务器提供。我面临的问题是所有连接的 wifi 设备都没有获得 IPv4 地址。它们虽然能够通过 IPv6 连接到 Internet,但无法连接到 Internet 上的任何 IPv4 目标。在任何 wifi 客户端(Android 或 Windows 10)上浏览基于 IPv6 的网站都可以正常工作。

Linux raspberrypi4 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux hostapd v2.8-devel

wifi hostapd
  • 1 个回答
  • 367 Views
Martin Hope
Antoine Boré
Asked: 2019-05-06 19:25:03 +0800 CST

Hostapd 不适用于我的一台设备

  • 2

我正在尝试将我的 Raspberry Pi Compute Module 3+ 设置为带有 WiFi 加密狗的接入点的接入点。

我正在关注本教程:https ://elinux.org/RPI-Wireless-Hotspot 。

我可以使用加密狗 EP-N8508GS 设置接入点,但是当我尝试使用 TL-WN722N 时,出现以下错误:

pi@raspberrypi:~ $ sudo service hostapd start
Job for hostapd.service failed because the control process exited with error code.
See "systemctl status hostapd.service" and "journalctl -xe" for details.

这似乎是 nl80211 驱动程序的问题,但我真的不明白为什么它适用于第一个加密狗而不适用于另一个加密狗。我想尝试使用 tp-link 加密狗,因为第一个不支持 AP 模式并在设备尝试连接时使 kernell 崩溃。

$ 服务主机状态

pi@raspberrypi:~ $ service hostapd status
● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
   Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Mon 2019-05-06 03:49:27 BST; 1
  Process: 1103 ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF

May 06 03:49:27 raspberrypi systemd[1]: hostapd.service: Control process exited, code=exited
May 06 03:49:27 raspberrypi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.
May 06 03:49:27 raspberrypi systemd[1]: hostapd.service: Unit entered failed state.
May 06 03:49:27 raspberrypi systemd[1]: hostapd.service: Failed with result 'exit-code'.

$ journalctl -xe

pi@raspberrypi:~ $ journalctl -xe
May 06 04:10:22 raspberrypi hostapd[619]: nl80211: Driver does not support authentication/ass
May 06 04:10:22 raspberrypi hostapd[619]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
May 06 04:10:22 raspberrypi hostapd[619]: nl80211 driver initialization failed.
May 06 04:10:22 raspberrypi hostapd[619]: wlan0: interface state UNINITIALIZED->DISABLED
May 06 04:10:22 raspberrypi hostapd[619]: wlan0: AP-DISABLED
May 06 04:10:22 raspberrypi hostapd[619]: hostapd_free_hapd_data: Interface wlan0 wasn't star
May 06 04:10:22 raspberrypi systemd[1]: hostapd.service: Control process exited, code=exited
May 06 04:10:22 raspberrypi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.
-- Subject: Unit hostapd.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit hostapd.service has failed.
--
-- The result is failed.
May 06 04:10:22 raspberrypi systemd[1]: hostapd.service: Unit entered failed state.
May 06 04:10:22 raspberrypi systemd[1]: hostapd.service: Failed with result 'exit-code'.
May 06 04:10:25 raspberrypi systemd[1]: hostapd.service: Service hold-off time over, scheduli
May 06 04:10:25 raspberrypi systemd[1]: Stopped Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/W
-- Subject: Unit hostapd.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit hostapd.service has finished shutting down.
May 06 04:10:25 raspberrypi systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/
-- Subject: Unit hostapd.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit hostapd.service has begun starting up.
May 06 04:10:25 raspberrypi hostapd[621]: Configuration file: /etc/hostapd/hostapd.conf
May 06 04:10:25 raspberrypi hostapd[621]: nl80211: Driver does not support authentication/ass
May 06 04:10:25 raspberrypi hostapd[621]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
May 06 04:10:25 raspberrypi hostapd[621]: nl80211 driver initialization failed.
May 06 04:10:25 raspberrypi hostapd[621]: wlan0: interface state UNINITIALIZED->DISABLED
May 06 04:10:25 raspberrypi hostapd[621]: wlan0: AP-DISABLED
May 06 04:10:25 raspberrypi hostapd[621]: hostapd_free_hapd_data: Interface wlan0 wasn't star
May 06 04:10:25 raspberrypi systemd[1]: hostapd.service: Control process exited, code=exited
May 06 04:10:25 raspberrypi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.
-- Subject: Unit hostapd.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit hostapd.service has failed.
--
-- The result is failed.
May 06 04:10:25 raspberrypi systemd[1]: hostapd.service: Unit entered failed state.
May 06 04:10:25 raspberrypi systemd[1]: hostapd.service: Failed with result 'exit-code'.

我的配置:

/lib/systemd/system/hostapd.service

pi@raspberrypi:~ $ cat /lib/systemd/system/hostapd.service
[Unit]
Description=Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
After=network.target

[Service]
Type=forking
PIDFile=/run/hostapd.pid
Restart=on-failure
RestartSec=2
EnvironmentFile=/etc/default/hostapd
ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF}

/etc/default/hostapd

pi@raspberrypi:~ $ cat /etc/default/hostapd
# Defaults for hostapd initscript
#
# See /usr/share/doc/hostapd/README.Debian for information about alternative
# methods of managing hostapd.
#
# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
# file and hostapd will be started during system boot. An example configuration
# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
#
DAEMON_CONF="/etc/hostapd/hostapd.conf"

# Additional daemon options to be appended to hostapd command:-
#       -d   show more debug messages (-dd for even more)
#       -K   include key data in debug messages
#       -t   include timestamps in some debug messages
#
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
#DAEMON_OPTS=""

/etc/hostapd/hostapd.conf

pi@raspberrypi:~ $ cat /etc/hostapd/hostapd.conf
interface=wlan0
ssid=MyAP
hw_mode=g
channel=1
auth_algs=1
ieee80211n=1          # 802.11n support
wmm_enabled=1         # QoS support
ht_capab=[HT40+][SHORT-GI-20][DSSS_CCK-40]
raspberry-pi hostapd
  • 1 个回答
  • 2727 Views
Martin Hope
ZioByte
Asked: 2018-10-05 02:11:27 +0800 CST

设置 Dnsmaq 为 Hostapd 热点提供 DHCP 地址

  • 1

我正在尝试设置 dnsmasq 作为基于 hostapd 的 WiFi 热点的 DHCP 服务器。

当客户端连接 WAP2 协商成功,但 dnsmasq 始终输出以下错误。

[ 2081.576809] DHCP[wlan0] - DISCOVER [TX][ 2081.580476]                        
[ 2081.582008] DHCP[wlan0] - DISCOVER [RX]                                      
dnsmasq-dhcp: no address range available for DHCP request via wlan0             
[ 2085.297432] DHCP[wlan0] - DISCOVER [TX][ 2085.301107]                        
[ 2085.302630] DHCP[wlan0] - DISCOVER [RX]                                      
dnsmasq-dhcp: no address range available for DHCP request via wlan0             

这些通常意味着配置的范围与设备设置不兼容。

如果是这种情况,我不明白为什么。

我的测试dnsmaq.conf非常基础:

root@imx8qxpa0tcuap:~# cat /etc/dnsmasq.conf                                    
domain-needed                                                                   
bogus-priv                                                                      
interface=wlan0                                                                 
dhcp-range=192.168.207.20,192.168.207.50,12h                                    

...并且当前的网络设置应该兼容:

root@imx8qxpa0tcuap:~# ip addr show wlan0
5: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP 0
    link/ether a0:cc:2b:a5:e0:05 brd ff:ff:ff:ff:ff:ff
    inet 192.168.207.1/32 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::a2cc:2bff:fea5:e005/64 scope link
       valid_lft forever preferred_lft forever
root@imx8qxpa0tcuap:~# ip route
192.168.207.0/24 dev wlan0 scope link

最初的 dnsmasq 打印输出显示没有问题:

root@imx8qxpa0tcuap:~# dnsmasq -d
dnsmasq: started, version 2.78 cachesize 150
dnsmasq: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPy
dnsmasq-dhcp: DHCP, IP range 192.168.207.20 -- 192.168.207.50, lease time 12h
dnsmasq: reading /etc/resolv.conf
dnsmasq: using nameserver 8.8.8.8#53
dnsmasq: using nameserver 8.8.4.4#53
dnsmasq: using nameserver 2001:4860:4860::8888#53
dnsmasq: using nameserver 2001:4860:4860::8844#53
dnsmasq: read /etc/hosts - 6 addresses

我究竟做错了什么?

注意 1:在此测试设置中,WiFi 热点无处可去(但)只有客户端和热点本身之间的通信才应该工作。

注意2:该机器是运行基于 Yocto 的发行版的定制板 (i.MX8)。

dnsmasq hostapd
  • 1 个回答
  • 2655 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve