Ubuntu 14.04 + hostapd + 802.11a + iwlwifi = 无 AP!

Ubuntu 14.04 + hostapd + 802.11a + iwlwifi = 无 AP!

这是我第一次来这里,所以请多多包涵。;)

我有以下问题:

我想设置一个 5GHz WiFi-AP,因为 2.4GHz 太拥挤。

我使用的是 Ubuntu 14.04,带有“Intel Corporation Wireless 3160 (rev 83)”wifi 芯片。下面是一些相关信息:

#lspci
01:00.0 Network controller: Intel Corporation Wireless 3160 (rev 83)

驱动程序使用:

#dmesg | grep iwl
[   15.421854] iwlwifi 0000:01:00.0: irq 78 for MSI/MSI-X
[   15.902471] iwlwifi 0000:01:00.0: loaded firmware version 22.24.8.0 op_mode iwlmvm
[   15.939685] iwlwifi 0000:01:00.0: Detected Intel(R) Dual Band Wireless AC 3160, REV=0x164
[   15.939772] iwlwifi 0000:01:00.0: L1 Enabled; Disabling L0S
[   15.940031] iwlwifi 0000:01:00.0: L1 Enabled; Disabling L0S
[   16.043741] ieee80211 phy0: Selected rate control algorithm 'iwl-mvm-rs'
[   16.572386] iwlwifi 0000:01:00.0: L1 Enabled; Disabling L0S
[   16.572645] iwlwifi 0000:01:00.0: L1 Enabled; Disabling L0S
[   23.782843] iwlwifi 0000:01:00.0: L1 Enabled; Disabling L0S
[   23.783099] iwlwifi 0000:01:00.0: L1 Enabled; Disabling L0S

#cfg80211: Calling CRDA to update world regulatory domain
[   16.108973] cfg80211: World regulatory domain updated:
[   16.108984] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   16.108989] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   16.108993] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   16.108997] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   16.109000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   16.109004] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   16.109029] cfg80211: Calling CRDA for country: DE
[   16.114458] cfg80211: Regulatory domain changed to country: DE
[   16.114465] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   16.114470] cfg80211:   (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   16.114473] cfg80211:   (5150000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   16.114477] cfg80211:   (5250000 KHz - 5350000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[   16.114480] cfg80211:   (5470000 KHz - 5725000 KHz @ 40000 KHz), (N/A, 2698 mBm)
[   16.114483] cfg80211:   (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm)

芯片的能力:支持AP模式。

#iw list
Wiphy phy0
Band 1:
    Capabilities: 0x1062
        HT20/HT40
        Static SM Power Save
        RX HT20 SGI
        RX HT40 SGI
        No RX STBC
        Max AMSDU length: 3839 bytes
        DSSS/CCK HT40
    Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
    Minimum RX AMPDU time spacing: 4 usec (0x05)
    HT TX/RX MCS rate indexes supported: 0-7, 32
    Frequencies:
        * 2412 MHz [1] (16.0 dBm)
        * 2417 MHz [2] (16.0 dBm)
        * 2422 MHz [3] (16.0 dBm)
        * 2427 MHz [4] (16.0 dBm)
        * 2432 MHz [5] (16.0 dBm)
        * 2437 MHz [6] (16.0 dBm)
        * 2442 MHz [7] (16.0 dBm)
        * 2447 MHz [8] (16.0 dBm)
        * 2452 MHz [9] (16.0 dBm)
        * 2457 MHz [10] (16.0 dBm)
        * 2462 MHz [11] (16.0 dBm)
        * 2467 MHz [12] (16.0 dBm) (passive scanning, no IBSS)
        * 2472 MHz [13] (16.0 dBm) (passive scanning, no IBSS)
    Bitrates (non-HT):
        * 1.0 Mbps
        * 2.0 Mbps (short preamble supported)
        * 5.5 Mbps (short preamble supported)
        * 11.0 Mbps (short preamble supported)
        * 6.0 Mbps
        * 9.0 Mbps
        * 12.0 Mbps
        * 18.0 Mbps
        * 24.0 Mbps
        * 36.0 Mbps
        * 48.0 Mbps
        * 54.0 Mbps
Band 2:
    Capabilities: 0x1062
        HT20/HT40
        Static SM Power Save
        RX HT20 SGI
        RX HT40 SGI
        No RX STBC
        Max AMSDU length: 3839 bytes
        DSSS/CCK HT40
    Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
    Minimum RX AMPDU time spacing: 4 usec (0x05)
    HT TX/RX MCS rate indexes supported: 0-7, 32
    Frequencies:
        * 5180 MHz [36] (16.0 dBm) (passive scanning, no IBSS)
        * 5200 MHz [40] (16.0 dBm) (passive scanning, no IBSS)
        * 5220 MHz [44] (16.0 dBm) (passive scanning, no IBSS)
        * 5240 MHz [48] (16.0 dBm) (passive scanning, no IBSS)
        * 5260 MHz [52] (16.0 dBm) (passive scanning, no IBSS, radar detection)
        * 5280 MHz [56] (16.0 dBm) (passive scanning, no IBSS, radar detection)
        * 5300 MHz [60] (16.0 dBm) (passive scanning, no IBSS, radar detection)
        * 5320 MHz [64] (16.0 dBm) (passive scanning, no IBSS, radar detection)
        * 5500 MHz [100] (16.0 dBm) (passive scanning, no IBSS, radar detection)
        * 5520 MHz [104] (16.0 dBm) (passive scanning, no IBSS, radar detection)
        * 5540 MHz [108] (16.0 dBm) (passive scanning, no IBSS, radar detection)
        * 5560 MHz [112] (16.0 dBm) (passive scanning, no IBSS, radar detection)
        * 5580 MHz [116] (16.0 dBm) (passive scanning, no IBSS, radar detection)
        * 5600 MHz [120] (16.0 dBm) (passive scanning, no IBSS, radar detection)
        * 5620 MHz [124] (16.0 dBm) (passive scanning, no IBSS, radar detection)
        * 5640 MHz [128] (16.0 dBm) (passive scanning, no IBSS, radar detection)
        * 5660 MHz [132] (16.0 dBm) (passive scanning, no IBSS, radar detection)
        * 5680 MHz [136] (16.0 dBm) (passive scanning, no IBSS, radar detection)
        * 5700 MHz [140] (16.0 dBm) (passive scanning, no IBSS, radar detection)
        * 5720 MHz [144] (disabled)
        * 5745 MHz [149] (disabled)
        * 5765 MHz [153] (disabled)
        * 5785 MHz [157] (disabled)
        * 5805 MHz [161] (disabled)
        * 5825 MHz [165] (disabled)
    Bitrates (non-HT):
        * 6.0 Mbps
        * 9.0 Mbps
        * 12.0 Mbps
        * 18.0 Mbps
        * 24.0 Mbps
        * 36.0 Mbps
        * 48.0 Mbps
        * 54.0 Mbps
max # scan SSIDs: 20
max scan IEs length: 393 bytes
Coverage class: 0 (up to 0m)
Supported Ciphers:
    * WEP40 (00-0f-ac:1)
    * WEP104 (00-0f-ac:5)
    * TKIP (00-0f-ac:2)
    * CCMP (00-0f-ac:4)
    * CMAC (00-0f-ac:6)
Available Antennas: TX 0 RX 0
Supported interface modes:
     * IBSS
     * managed
     * AP
     * AP/VLAN
     * monitor
     * P2P-client
     * P2P-GO
     * Unknown mode (10)
software interface modes (can always be added):
     * AP/VLAN
     * monitor
valid interface combinations:
     * #{ managed } <= 1, #{ AP, P2P-client, P2P-GO } <= 1, #{ Unknown mode (10) } <= 1,
       total <= 3, #channels <= 1
Supported commands:
     * new_interface
     * set_interface
     * new_key
     * new_beacon
     * new_station
     * new_mpath
     * set_mesh_params
     * set_bss
     * authenticate
     * associate
     * deauthenticate
     * disassociate
     * join_ibss
     * join_mesh
     * remain_on_channel
     * set_tx_bitrate_mask
     * action
     * frame_wait_cancel
     * set_wiphy_netns
     * set_channel
     * set_wds_peer
     * Unknown command (84)
     * Unknown command (87)
     * Unknown command (85)
     * Unknown command (89)
     * Unknown command (92)
     * connect
     * disconnect
Supported TX frame types:
     * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
     * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
     * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
     * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
     * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
     * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
     * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
     * Unknown mode (10): 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
Supported RX frame types:
     * IBSS: 0x40 0xb0 0xc0 0xd0
     * managed: 0x40 0xd0
     * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
     * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
     * mesh point: 0xb0 0xc0 0xd0
     * P2P-client: 0x40 0xd0
     * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
     * Unknown mode (10): 0x40 0xd0
Device supports RSN-IBSS.
WoWLAN support:
     * wake up on disconnect
     * wake up on magic packet
     * wake up on pattern match, up to 20 patterns of 16-128 bytes
     * can do GTK rekeying
     * wake up on GTK rekey failure
     * wake up on EAP identity request
     * wake up on 4-way handshake
     * wake up on rfkill release
HT Capability overrides:
     * MCS: ff ff ff ff ff ff ff ff ff ff
     * maximum A-MSDU length
     * supported channel width
     * short GI for 40 MHz
     * max A-MPDU length exponent
     * min MPDU start spacing
Device supports TX status socket option.
Device supports HT-IBSS.

2.4GHz 部分看起来不错,但“Band 2”中的“无 IBSS”似乎很奇怪。

这是 hostapd 的配置:

# cat /etc/hostapd/hostapd.conf

interface=wlan0
driver=nl80211
ssid=xxx
channel=48
ignore_broadcast_ssid=0
country_code=DE
ieee80211d=1
hw_mode=a
ieee80211n=1
ht_capab=[HT40-][SHORT-GI-40][DSSS_CCK-40]
beacon_int=100
dtim_period=2
macaddr_acl=0
max_num_sta=10
rts_threshold=2347
fragm_threshold=2346
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
auth_algs=3
wmm_enabled=1
wpa=2
rsn_preauth=1
rsn_preauth_interfaces=wlan0
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_group_rekey=600
wpa_ptk_rekey=600
wpa_gmk_rekey=86400
wpa_passphrase=xxx

这是 hostapd 的输出:

#sudo hostapd /etc/hostapd/hostapd.conf -dd
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
ctrl_interface_group=0
nl80211: Could not add multicast membership for vendor events: -2 (No such file or directory)
rfkill: initial event: idx=0 type=2 op=0 soft=0 hard=0
rfkill: initial event: idx=1 type=1 op=0 soft=0 hard=0
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-0f-ac:6
nl80211: Using driver-based off-channel TX
nl80211: Use separate P2P group interface (driver advertised support)
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 3 iftype 3 (AP)
nl80211: Failed to set interface 3 to mode 3: -16 (Device or resource busy)
nl80211: Try mode change after setting interface down
nl80211: Set mode ifindex 3 iftype 3 (AP)
nl80211: Mode change succeeded while interface is down
nl80211: Setup AP(wlan0) - device_ap_sme=0 use_monitor=0
nl80211: Subscribe to mgmt frames with AP handle 0xb497b0
nl80211: Register frame type=0xb0 nl_handle=0xb497b0 match=
nl80211: Register frame type=0x0 nl_handle=0xb497b0 match=
nl80211: Register frame type=0x20 nl_handle=0xb497b0 match=
nl80211: Register frame type=0xa0 nl_handle=0xb497b0 match=
nl80211: Register frame type=0xc0 nl_handle=0xb497b0 match=
nl80211: Register frame type=0xd0 nl_handle=0xb497b0 match=
nl80211: Register frame type=0x40 nl_handle=0xb497b0 match=
nl80211: Add own interface ifindex 3
nl80211: Do not indicate P2P_DEVICE support (p2p_device=1 driver param not specified)
phy: phy0
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Previous country code DE, new country code DE 
nl80211: Regulatory information - country=DE
nl80211: 2400-2483 @ 40 MHz 20 mBm
nl80211: 5150-5250 @ 40 MHz 20 mBm
nl80211: 5250-5350 @ 40 MHz 20 mBm
nl80211: 5470-5725 @ 40 MHz 26 mBm
nl80211: 57240-65880 @ 2160 MHz 40 mBm
nl80211: Added 802.11b mode based on 802.11g information
Allowed channel: mode=1 chan=1 freq=2412 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=2 freq=2417 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=3 freq=2422 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=4 freq=2427 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=5 freq=2432 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=6 freq=2437 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=7 freq=2442 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=8 freq=2447 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=9 freq=2452 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=10 freq=2457 MHz max_tx_power=20 dBm
Allowed channel: mode=1 chan=11 freq=2462 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=1 freq=2412 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=2 freq=2417 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=3 freq=2422 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=4 freq=2427 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=5 freq=2432 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=6 freq=2437 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=7 freq=2442 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=8 freq=2447 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=9 freq=2452 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=10 freq=2457 MHz max_tx_power=20 dBm
Allowed channel: mode=0 chan=11 freq=2462 MHz max_tx_power=20 dBm
**channel [3] (48) is disabled for use in AP mode, flags: 0x77 NO-IBSS PASSIVE-SCAN**
**wlan0: IEEE 802.11 Configured channel (48) not found from the channel list of current mode (2) IEEE 802.11a**
**wlan0: IEEE 802.11 Hardware does not support configured channel**
**Could not select hw_mode and channel. (-3)**
**wlan0: Unable to setup interface.**
hostapd_interface_deinit_free(0xb48d90)
hostapd_interface_deinit_free: num_bss=1 conf->num_bss=1
hostapd_interface_deinit(0xb48d90)
hostapd_bss_deinit: deinit bss wlan0
wlan0: Flushing old station entries
nl80211: flush -> DEL_STATION wlan0 (all)
wlan0: Deauthenticate all stations
nl80211: send_mlme - noack=0 freq=0 no_cck=0 offchanok=0 wait_time=0 fc=0xc0 nlmode=3
nl80211: send_mlme -> send_frame
nl80211: send_frame - Use bss->freq=0
nl80211: send_frame -> send_frame_cmd
nl80211: CMD_FRAME freq=0 wait=0 no_cck=0 no_ack=0 offchanok=0
CMD_FRAME - hexdump(len=26): c0 00 00 00 ff ff ff ff ff ff a0 88 69 24 65 da a0 88 69 24 65 da 00 00 03 00
nl80211: Frame command failed: ret=-22 (Invalid argument) (freq=0 wait=0)
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 (wlan0) alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
hostapd_cleanup(hapd=0xb4c760 (wlan0))
hostapd_free_hapd_data: Interface wlan0 wasn't started
hostapd_interface_deinit_free: driver=0x4bc6c0 drv_priv=0xb4d6a0 -> hapd_deinit
nl80211: Remove monitor interface: refcount=0
nl80211: Remove beacon (ifindex=3)
netlink: Operstate: ifindex=3 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211: Failed to set interface 3 to mode 2: -16 (Device or resource busy)
nl80211: Try mode change after setting interface down
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211: Mode change succeeded while interface is down
nl80211: Teardown AP(wlan0) - device_ap_sme=0 use_monitor=0
nl80211: Unsubscribe mgmt frames handle 0x88888888883c1f39 (AP teardown)
hostapd_interface_free(0xb48d90)
hostapd_interface_free: free hapd 0xb4c760
hostapd_cleanup_iface(0xb48d90)
hostapd_cleanup_iface_partial(0xb48d90)
hostapd_cleanup_iface: free iface=0xb48d90

我已经在 Google 上搜索了很多次,但没有找到合适的。大多数情况下,这些都是 regdomain 错误。

我用**标记了hostapd的有趣输出

如果我为 hw_mode=g 和 channel 1 配置 hostapd,一切就都正常了。

我感激每一份帮助!

亲切的问候

答案1

在 5GHz 频谱中,您可能需要使用自动信道选择 (ACS)。自 2013 年 8 月起,如果您启用

ieee80211d=1
ieee80211h=1
channel=0

我还没有设法让我的 Intel 6205 卡返回有效的频谱调查来启动 ACS 进程。我的印象是 ath9k 驱动程序和卡可能更适合使用 hostapd 的 5GHz。另请参阅http://wireless.kernel.org/en/users/Documentation/acs

答案2

我在使用英特尔 8260 WiFi 适配器时也遇到了同样的问题:iw list报告称所有 5 GHz 信道要么是(disabled),要么是(passive scanning, no IBSS)。由于上述固件限制,Hostapd 无法在 5 GHz 模式下创建 AP,这些限制是官方确认的由英特尔提供。

看起来,与英特尔驱动程序/固件不兼容的实际原因是 5 GHz 模式下的国家代码设置,因此将其保留在默认(最受限制)的 00 区域。

但是,我找到了一种解决方法,允许设置国家代码并使 hostapd 能够启动 5 GHz AP。我只在一个系统上使用一个无线网卡测试了这个解决方案。它可能只对我有用。我的系统是 Ubuntu Trusty 14.04,带有一些软件升级。

我必须安装较新版本的 Ubuntu Linux 内核才能启用 Intel 8260 支持:

$ apt-get install linux-generic-lts-wily
$ uname -a
Linux htpc.myhome 4.2.0-42-generic #49~14.04.1-Ubuntu SMP Wed Jun 29 20:22:11 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

此外,我还必须编写一份更新的hostapd 2.4来自 Ubuntu Xenial 的软件包以获得 802.11ac 支持。

下面是我如何使它工作的描述。

1 创建补充 hostapd 配置文件 /etc/hostapd/hostapd.conf.enable-5ghz,内容如下:

interface=wlan0
driver=nl80211
country_code=US
ieee80211n=1

2 使用补充配置文件启动 hostapd:

hostapd /etc/hostapd/hostapd.conf.enable-5ghz

它将失败并显示以下消息:

Configuration file: /etc/hostapd/hostapd.conf.enable-5ghz
HT (IEEE 802.11n) in 11b mode is not allowed, disabling HT capabilities
wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
ACS: Automatic channel selection started, this may take a bit
wlan0: interface state COUNTRY_UPDATE->ACS
wlan0: ACS-STARTED 
ACS: Unable to collect survey data
ACS: All study options have failed
Interface initialization failed
wlan0: interface state ACS->DISABLED
wlan0: AP-DISABLED 
ACS: Possibly channel configuration is invalid, please report this along with your config file.
ACS: Failed to start
wlan0: AP-DISABLED 
hostapd_free_hapd_data: Interface wlan0 wasn't started
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
wlan0: interface state DISABLED->DISABLED
wlan0: interface state DISABLED->DISABLED
wlan0: AP-DISABLED 
hostapd_free_hapd_data: Interface wlan0 wasn't started

这很好,因为它确实起了作用 -iw list现在报告说有一些 5 GHz 频道可用:

    * 5745 MHz [149] (22.0 dBm)
    * 5765 MHz [153] (22.0 dBm)
    * 5785 MHz [157] (22.0 dBm)
    * 5805 MHz [161] (22.0 dBm)
    * 5825 MHz [165] (22.0 dBm)

3 创建一个实际的 hostapd 配置文件 /etc/hostapd/hostapd.conf:

ssid=MY-SSID
wpa_passphrase=my-secret-password

country_code=US

interface=wlan0
driver=nl80211

wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP

hw_mode=a
ieee80211n=1
require_ht=1
ieee80211ac=1
require_vht=1

channel=153

4 使用实际的配置文件启动 hostapd:

hostapd /etc/hostapd/hostapd.conf

这次运行正常:

Configuration file: /etc/hostapd/hostapd.conf
wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Using interface wlan0 with hwaddr 34:f6:4b:aa:bb:cc and ssid "MY-SSID"
wlan0: interface state COUNTRY_UPDATE->ENABLED
wlan0: AP-ENABLED 

5 通过添加准备/etc/network/interfaces 的 wlan0 部分中添加以下行:

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
    address 192.168.1.1
    netmask 255.255.255.0
    network 192.168.1.0
    pre-up /usr/sbin/hostapd /etc/hostapd/hostapd.conf.enable-5ghz >/dev/null 2>&1 || true

希望这对其他人有帮助。

答案3

正如您在“iw list”报告的频率列表中看到的,5 GHz 信道仅允许“被动扫描”。

监管问题,但与内核使用的 regdomain 无关。(某些?)英特尔卡的固件似乎禁止在 AP 模式下使用 Band 2,而且据我所知,驱动程序或内核代码中没有解决方法。

我在使用 Intel 7260AC+BT 时遇到了同样的问题 - 在 AP 模式下只有 Band 1 可用。

答案4

这是 Ubuntu 14.04 自带的 hostapd 的问题。

要解决此问题,请安装以前版本的 hostapd。

https://bugs.launchpad.net/ubuntu/+source/wpa/+bug/1289047

相关内容