'Running Intel 7260 in AP mode under Ubuntu 14.04

I would like to use the built-in WiFi on a Gigabyte mini-ITX system I just bought as an access point. And for some reason I am going in circles.

lspci | grep -i wireless reveals:

04:00.0 Network controller: Intel Corporation Wireless 7260 (rev 73)

lsmod | grep 80211 gives:

mac80211              630669  1 iwlmvm
cfg80211              484040  3 iwlwifi,mac80211,iwlmvm

I installed hostapd. Here is the (more than) minimal hostapd.conf I created:

interface=wlan0
driver=nl80211
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=test
hw_mode=g
channel=1
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
auth_algs=3
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
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
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
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_txop_limit=47
own_ip_addr=127.0.0.1

When I try to run hostapd, I get this:

$ sudo hostapd ./hostapd.conf

Configuration file: ./hostapd.conf
nl80211: Could not configure driver mode
nl80211 driver initialization failed.
hostapd_free_hapd_data: Interface wlan0 wasn't started

So, I read there was a problem with Ubuntu 14.04 and how to get around it.

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

Interestingly it appears that now the driver (version 2.1) does something with error, and before it ignored it.

a solution (in desktop cases) is to do following to release resource.. then hostapd has no error....

sudo nmcli nm wifi off
sudo rfkill unblock wlan

this info has been gleaned from https://bbs.archlinux.org/viewtopic.php?pid=1221799

nmcli is part of network-manager, which needed to be installed. Next,

/etc/hostapd$ sudo nmcli nm wifi off
** (process:5724): WARNING **: Could not initialize NMClient /org/freedesktop/NetworkManager: The name org.freedesktop.NetworkManager was not provided by any .service files

So I ran these commands, which are supposedly a workaround.

/etc/hostapd$ sudo service network-manager start
network-manager start/running, process 5763
/etc/hostapd$ sudo nmcli nm wifi off
/etc/hostapd$ sudo rfkill unblock wlan

But still the same problem with trying to run hostapd.

https://askubuntu.com/questions/472794/hostapd-error-nl80211-could-not-configure-driver-mode recommends this:

sudo ifconfig wlan0 10.15.0.1/24 up 
sleep 1 
sudo service isc-dhcp-server restart 
sudo service hostapd restart

isc-dhcp-server is not yet installed. Everything else ran without showing any error.

Still having the problem though!

ifconfig wlan0 shows:

wlan0     Link encap:Ethernet  HWaddr 80:19:34:32:20:a3
          inet addr:10.15.0.1  Bcast:10.15.0.255  Mask:255.255.255.0
          inet6 addr: fd04:bd3:80e8:1:91e9:7f2e:f005:5af9/64 Scope:Global
          inet6 addr: fe80::8219:34ff:fe32:20a3/64 Scope:Link
          inet6 addr: fd04:bd3:80e8:1:8219:34ff:fe32:20a3/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:43138 errors:0 dropped:0 overruns:0 frame:0
          TX packets:638 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6824297 (6.8 MB)  TX bytes:121399 (121.3 KB)

iw list shows:

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-15, 32
                Frequencies:
                        * 2412 MHz [1] (22.0 dBm)
                        * 2417 MHz [2] (22.0 dBm)
                        * 2422 MHz [3] (22.0 dBm)
                        * 2427 MHz [4] (22.0 dBm)
                        * 2432 MHz [5] (22.0 dBm)
                        * 2437 MHz [6] (22.0 dBm)
                        * 2442 MHz [7] (22.0 dBm)
                        * 2447 MHz [8] (22.0 dBm)
                        * 2452 MHz [9] (22.0 dBm)
                        * 2457 MHz [10] (22.0 dBm)
                        * 2462 MHz [11] (22.0 dBm)
                        * 2467 MHz [12] (22.0 dBm) (passive scanning, no IBSS)
                        * 2472 MHz [13] (22.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-15, 32
                Frequencies:
                        * 5180 MHz [36] (22.0 dBm) (passive scanning, no IBSS)
                        * 5200 MHz [40] (22.0 dBm) (passive scanning, no IBSS)
                        * 5220 MHz [44] (22.0 dBm) (passive scanning, no IBSS)
                        * 5240 MHz [48] (22.0 dBm) (passive scanning, no IBSS)
                        * 5260 MHz [52] (22.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5280 MHz [56] (22.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5300 MHz [60] (22.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5320 MHz [64] (22.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5500 MHz [100] (22.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5520 MHz [104] (22.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5540 MHz [108] (22.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5560 MHz [112] (22.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5580 MHz [116] (22.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5600 MHz [120] (22.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5620 MHz [124] (22.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5640 MHz [128] (22.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5660 MHz [132] (22.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5680 MHz [136] (22.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5700 MHz [140] (22.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5720 MHz [144] (22.0 dBm) (passive scanning, no IBSS, radar detection)
                        * 5745 MHz [149] (22.0 dBm) (passive scanning, no IBSS)
                        * 5765 MHz [153] (22.0 dBm) (passive scanning, no IBSS)
                        * 5785 MHz [157] (22.0 dBm) (passive scanning, no IBSS)
                        * 5805 MHz [161] (22.0 dBm) (passive scanning, no IBSS)
                        * 5825 MHz [165] (22.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: 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.

Using iwconfig to set it to "Master" mode, which I think means to set it to AP mode, results in this:

$ sudo iwconfig wlan0 mode Master
Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; Invalid argument.

So, I guess it's possible that the 7260 driver does not want to work in AP mode. However, the iwlist command output shows AP mode as one of the possibilities.



Solution 1:[1]

(Question solved by edit. Converted to community wiki answer.)

The OP wrote:

All right, looks like happy day, I just needed to add this:

### Set your bridge name ###
bridge=br0

to the hostapd.conf file. Now I get:

$ sudo hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Using interface wlan0 with hwaddr 80:19:34:32:20:a3 and ssid "test"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1