“无法读取接口 wlan0 nl80211 驱动程序初始化失败。”

“无法读取接口 wlan0 nl80211 驱动程序初始化失败。”

我尝试启动 hostapd,但没有成功。我使用的是 Headless Ubuntu 11.10 oneiric 3.0.0-16-server x86_64。WLAN 驱动程序是 rt2800usb,我的无线网卡 TP-Link TL-WN727N 支持 AP 模式,如下所示:

us0# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 00:27:19:be:cd:b6  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

us0# lsusb
Bus 003 Device 003: ID 148f:3070 Ralink Technology, Corp. RT2870/RT3070
                    Wireless Adapter
us0# lshw -C network
*-network:3
       description: Wireless interface
       physical id: 4
       bus info: usb@3:2
       logical name: wlan0
       serial: 00:27:19:be:cd:b6
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=rt2800usb driverversion=3.0.0-16-server
                      firmware=0.29 link=no multicast=yes wireless=IEEE 802.11bgn

us0# hostapd /etc/hostapd/hostapd.conf 
Configuration file: /etc/hostapd/hostapd.conf
Could not read interface wlan0      # The int flags: No such device
nl80211 driver initialization failed.
ELOOP: remaining socket: sock=4 eloop_data=0xd3e4a0 user_data=0xd3ecc0 handler=0x433880
ELOOP: remaining socket: sock=6 eloop_data=0xd411f0 user_data=(nil) handler=0x43cc10

us0# cat /etc/hostapd/hostapd.conf
       ssid=Home
       interface=wlan0         # The interface name of the card
       #driver=rt2800usb
       driver=nl80211
       macaddr_acl=0

       ieee80211n=1
       channel=1
       hw_mode=g

       auth_algs=1
       ignore_broadcast_ssid=0
       wpa=2
       wpa_passphrase=88888888
       wpa_key_mgmt=WPA-PSK
       wpa_pairwise=TKIP
       rsn_pairwise=CCMP

us0# iw list
Wiphy phy0
    Band 1:
        Capabilities: 0x172
            HT20/HT40
            Static SM Power Save
            RX Greenfield
            RX HT20 SGI
            RX HT40 SGI
            RX STBC 1-stream
            Max AMSDU length: 7935 bytes
            No DSSS/CCK HT40
        Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
        Minimum RX AMPDU time spacing: 2 usec (0x04)
        HT RX MCS rate indexes supported: 0-7, 32
        TX unequal modulation not supported
        HT TX Max spatial streams: 1
        HT TX MCS rate indexes supported may differ
        Frequencies:
            * 2412 MHz [1] (20.0 dBm)
            * 2417 MHz [2] (20.0 dBm)
            * 2422 MHz [3] (20.0 dBm)
            * 2427 MHz [4] (20.0 dBm)
            * 2432 MHz [5] (20.0 dBm)
            * 2437 MHz [6] (20.0 dBm)
            * 2442 MHz [7] (20.0 dBm)
            * 2447 MHz [8] (20.0 dBm)
            * 2452 MHz [9] (20.0 dBm)
            * 2457 MHz [10] (20.0 dBm)
            * 2462 MHz [11] (20.0 dBm)
            * 2467 MHz [12] (20.0 dBm) (passive scanning, no IBSS)
            * 2472 MHz [13] (20.0 dBm) (passive scanning, no IBSS)
            * 2484 MHz [14] (20.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
    max # scan SSIDs: 4
    Supported interface modes:
         * IBSS
         * managed
         * AP
         * AP/VLAN
         * WDS
         * monitor
         * mesh point
    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
         * Unknown command (68)
         * Unknown command (55)
         * Unknown command (57)
         * Unknown command (59)
         * Unknown command (67)
         * set_wiphy_netns
         * Unknown command (65)
         * Unknown command (66)
         * connect
         * disconnect

问题是:为什么 hostapd 没有启动?

答案1

答案很简单:删除"interface=wlan0"in之后的所有内容(空格、注释等)。/etc/hostapd/hostapd.conf文件 并使用driver=nl80211.

相关内容