使用 iwlwifi 设备设置 hostapd 以运行热点

使用 iwlwifi 设备设置 hostapd 以运行热点

我正在尝试将我的 opensuse 13.1 系统配置为热点(在我的 dell xps13 计算机上)。

所以我尝试按照解释设置 hostapd这里,但我收到错误:

hostapd /etc/hostapd.conf
Configuration file: /etc/hostapd.conf
nl80211: Failed to set interface wlp1s0 into AP mode
nl80211 driver initialization failed.

我的 hostapd.conf 文件:

#interface=wlan0
interface=wlp1s0
driver=nl80211
bridge=br0

logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2

dump_file=/run/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
hw_mode=g
channel=3
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
ignore_broadcast_ssid=0


wmm_enabled=1
wmm_ac_bk_cwmin=4
wmm_ac_bk_cwmax=10
wmm_ac_bk_aifs=7
wmm_ac_bk_txop_limit=0
wmm_ac_bk_acm=0
# Note: for IEEE 802.11b mode: cWmin=5 cWmax=10
#
# Normal priority / AC_BE = best effort
wmm_ac_be_aifs=3
wmm_ac_be_cwmin=4
wmm_ac_be_cwmax=10
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
# Note: for IEEE 802.11b mode: cWmin=5 cWmax=7
#
# High priority / AC_VI = video
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmin=3
wmm_ac_vi_cwmax=4
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0
# Note: for IEEE 802.11b mode: cWmin=4 cWmax=5 txop_limit=188
#
# Highest priority / AC_VO = voice
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_txop_limit=47
wmm_ac_vo_acm=0
# Note: for IEEE 802.11b mode: cWmin=3 cWmax=4 burst=102


# EAPOL-Key index workaround (set bit7) for WinXP Supplicant (needed only if
# only broadcast keys are used)
eapol_key_index_workaround=0
# authentication server.
eap_server=0

# The own IP address of the access point (used as NAS-IP-Address)
own_ip_addr=127.0.0.1

问题可能出在驱动程序上。也许我应该指出另一个,因为:

>> lspci -k | grep -A 3 -i "network"
01:00.0 Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24)
        Subsystem: Intel Corporation Centrino Advanced-N 6235 AGN
        Kernel driver in use: iwlwifi
        Kernel modules: iwlwifi

更多网卡信息:

 >>hwinfo --netcard | grep -Ei "model|driver" 
  Model: "Intel WLAN controller"
  Driver: "iwlwifi"
  Driver Modules: "iwlwifi"
  Driver Info #0:
    Driver Status: iwlwifi is active
    Driver Activation Cmd: "modprobe iwlwifi"
  Model: "ASIX Electronics AX88x72A"
  Driver: "asix"
  Driver Modules: "asix"
  Driver Info #0:
    Driver Status: asix is active
    Driver Activation Cmd: "modprobe asix"

 >>modinfo iwlwifi | grep 'depend'
depends:        cfg80211

--update: 我检查了我的卡是否支持 AP,如下所示:

>>iw dev
phy#0
        Interface wlp1s0
                ifindex 2
                wdev 0x1
                addr c8:f7:33:da:ac:d7
                type managed



>>iw phy#0 info
Wiphy phy0
        Band 1:
                Capabilities: 0x1072                                                                                               
                        HT20/HT40                                                                                                  
                        Static SM Power Save
                        RX Greenfield
                        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-15, 32
                Frequencies:
                        * 2412 MHz [1] (15.0 dBm)
                        * 2417 MHz [2] (15.0 dBm)
                        * 2422 MHz [3] (15.0 dBm)
                        * 2427 MHz [4] (15.0 dBm)
                        * 2432 MHz [5] (15.0 dBm)
                        * 2437 MHz [6] (15.0 dBm)
                        * 2442 MHz [7] (15.0 dBm)
                        * 2447 MHz [8] (15.0 dBm)
                        * 2452 MHz [9] (15.0 dBm)
                        * 2457 MHz [10] (15.0 dBm)
                        * 2462 MHz [11] (15.0 dBm)
                        * 2467 MHz [12] (15.0 dBm) (passive scanning, no IBSS)
                        * 2472 MHz [13] (15.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: 0x1072
                        HT20/HT40
                        Static SM Power Save
                        RX Greenfield
                        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-15, 32
                Frequencies:
                        * 5180 MHz [36] (15.0 dBm) (passive scanning, no IBSS)
                        * 5200 MHz [40] (15.0 dBm) (passive scanning, no IBSS)
                        * 5220 MHz [44] (15.0 dBm) (passive scanning, no IBSS)
                        * 5240 MHz [48] (15.0 dBm) (passive scanning, no IBSS)
                        * 5260 MHz [52] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5280 MHz [56] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5300 MHz [60] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5320 MHz [64] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5500 MHz [100] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5520 MHz [104] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5540 MHz [108] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5560 MHz [112] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5580 MHz [116] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5600 MHz [120] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5620 MHz [124] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5640 MHz [128] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5660 MHz [132] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5680 MHz [136] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5700 MHz [140] (15.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5745 MHz [149] (15.0 dBm) (passive scanning, no IBSS)
                        * 5765 MHz [153] (15.0 dBm) (passive scanning, no IBSS)
                        * 5785 MHz [157] (15.0 dBm) (passive scanning, no IBSS)
                        * 5805 MHz [161] (15.0 dBm) (passive scanning, no IBSS)
                        * 5825 MHz [165] (15.0 dBm) (passive scanning, no IBSS)
                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: 195 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)
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * monitor
        software interface modes (can always be added):
                 * AP/VLAN
                 * monitor
        valid interface combinations:
                 * #{ managed } <= 1, #{ AP } <= 1,
                   total <= 2, #channels <= 1, STA/AP BI must match
                 * #{ managed } <= 2,
                   total <= 2, #channels <= 1
        Supported commands:
                 * new_interface
                 * set_interface
                 * new_key
                 * start_ap
                 * new_station
                 * new_mpath
                 * set_mesh_config
                 * set_bss
                 * authenticate
                 * associate
                 * deauthenticate
                 * disassociate
                 * join_ibss
                 * join_mesh
                 * remain_on_channel
                 * set_tx_bitrate_mask
                 * frame
                 * frame_wait_cancel
                 * set_wiphy_netns
                 * set_channel
                 * set_wds_peer
                 * probe_client
                 * set_noack_map
                 * register_beacons
                 * 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
                 * P2P-device: 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
                 * P2P-device: 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 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.

感谢您的任何见解和建议。我真的需要设置一个无线热点。

- 更新

我已经执行了以下命令,没有错误:

   nmcli nm wifi off
    rfkill unblock wlan

    ip link set dev wlp1s0 up
    ip address add 192.168.5.1/24 dev wlp1s0

    iptables -t nat -A POSTROUTING -s 192.168.5.0/24 -o enp0s20u2 -j MASQUERADE
    sysctl -w net.ipv4.ip_forward=1 1> /dev/null

    systemctl start hostapd.service
    systemctl start dnsmasq.service

我的 /etc/hostapd 是:

interface=wlp1s0
driver=nl80211
# bridge=br0
channel=3
hw_mode=g
auth_algs=1
ssid=test

我的手机可以看到测试网络。但一直说“正在获取IP地址......”

答案1

您在 hostapd conf 文件中指定了错误的驱动程序,使用 iwlwifi (intel) 而不是 nl80211 (atheros) 当您按照指南进行操作时,您必须阅读并更改您自己需要的任何必要内容。

答案2

如果您严格遵循本指南,您应该会成功:

http://www.cyberciti.biz/faq/debian-ubuntu-linux-setting-wireless-access-point/

我在 Ubuntu 14.04 服务器上使用了该指南。

剪切并粘贴到ssh客户端或 PuTTY 终端时要小心。我必须删除插入的额外空格,这会带来错误,将其解决,一切都很好。

目前正在尝试使用脚本来扩展本指南以更改接口,当虚拟机安全设备出现故障时,它将通过连接调制解调器的桥启动 WiFi 网络以绕过安全设备。

相关内容