# Hostapd problem

## Akaihiryuu

There was an update to hostapd today...since then I can't get it to work.  Getting this:

```
 * Starting hostapd ...

Configuration file: /etc/hostapd/hostapd.conf

nl80211: Could not configure driver mode

nl80211: deinit ifname=wlan0 disabled_11b_rates=0

nl80211 driver initialization failed.

wlan0: interface state UNINITIALIZED->DISABLED

wlan0: AP-DISABLED

hostapd_free_hapd_data: Interface wlan0 wasn't started

 * start-stop-daemon: failed to start `/usr/sbin/hostapd'

 * Failed to start hostapd

 * ERROR: hostapd failed to start
```

This is my hostapd.conf (nothing has changed).  I've been through it and don't see any problems and it worked before.

```
interface=wlan0

bridge=br0

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=triforce

hw_mode=g

channel=7

beacon_int=100

dtim_period=2

max_num_sta=255

rts_threshold=2347

fragm_threshold=2346

macaddr_acl=1

accept_mac_file=/etc/hostapd/hostapd.accept

deny_mac_file=/etc/hostapd/hostapd.deny

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

wmm_ac_vo_acm=0

wpa=3

wpa_passphrase=*******

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP

rsn_pairwise=CCMP

ieee80211n=1

ht_capab=[HT40-][HT40+][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40]

eapol_key_index_workaround=0

own_ip_addr=192.168.0.1
```

----------

## bbgermany

Hi,

Which version of hostapd do you use? Do you have net.wlan0 started? 

I had issues with hostapd as long as i haven't set the following for net.wlan0 in my /etc/conf/net

```

preup() {

        rfkill unblock all

        }

```

Maybe this helps you a bit.

----------

## Akaihiryuu

I completely shut down my bridge (net.br0) and then brought everything back up and it worked.  I guess something was holding the interface in such a way that hostapd couldn't set things properly.  I was originally just trying /etc/init.d/hostapd restart without doing anything else.  I think I'm going to add the rfkill command to preup anyway though because I did have a block error at some point during my messing with it.

----------

## solamour

I'm having the same problem, but I'm not using any bridges. Basically, I updated from "hostapd-2.0-r1" to "hostapd-2.4-r2", and this is what I'm getting.

```
# /etc/init.d/hostapd start

 * Caching service dependencies ...                                       [ ok ]

 * Starting hostapd ...

Configuration file: /etc/hostapd/hostapd.conf

nl80211: Could not configure driver mode

nl80211: deinit ifname=wlp0s15f5u1u4 disabled_11b_rates=0

nl80211 driver initialization failed.

wlp0s15f5u1u4: interface state UNINITIALIZED->DISABLED

wlp0s15f5u1u4: AP-DISABLED 

hostapd_free_hapd_data: Interface wlp0s15f5u1u4 wasn't started

 * start-stop-daemon: failed to start `/usr/sbin/hostapd'

 * Failed to start hostapd                                                [ !! ]

 * ERROR: hostapd failed to start

```

And I made sure nothing was blocked.

```
# rfkill list

4: phy4: Wireless LAN

        Soft blocked: no

        Hard blocked: no

```

Here is the output in the verbose mode.

```
# /usr/sbin/hostapd -dd /etc/hostapd/hostapd.conf

random: Trying to read entropy from /dev/random

Configuration file: /etc/hostapd/hostapd.conf

ctrl_interface_group=0

rfkill: initial event: idx=4 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: Using driver-based off-channel TX

nl80211: interface wlp0s15f5u1u4 in phy phy4

nl80211: Set mode ifindex 10 iftype 3 (AP)

nl80211: Setup AP(wlp0s15f5u1u4) - device_ap_sme=0 use_monitor=0

nl80211: Subscribe to mgmt frames with AP handle 0x9424830

nl80211: Register frame type=0xb0 (WLAN_FC_STYPE_AUTH) nl_handle=0x9424830 match=

nl80211: Register frame command failed (type=176): ret=-114 (Operation already in progress)

nl80211: Register frame match - hexdump(len=0): [NULL]

nl80211: Could not configure driver mode

nl80211: deinit ifname=wlp0s15f5u1u4 disabled_11b_rates=0

nl80211: Remove monitor interface: refcount=0

nl80211: Remove beacon (ifindex=10)

netlink: Operstate: ifindex=10 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)

nl80211 driver initialization failed.

hostapd_interface_deinit_free(0x9421720)

hostapd_interface_deinit_free: num_bss=1 conf->num_bss=1

hostapd_interface_deinit(0x9421720)

wlp0s15f5u1u4: interface state UNINITIALIZED->DISABLED

hostapd_bss_deinit: deinit bss wlp0s15f5u1u4

wlp0s15f5u1u4: AP-DISABLED 

hostapd_cleanup(hapd=0x9423f10 (wlp0s15f5u1u4))

hostapd_free_hapd_data: Interface wlp0s15f5u1u4 wasn't started

hostapd_interface_deinit_free: driver=(nil) drv_priv=(nil) -> hapd_deinit

hostapd_interface_free(0x9421720)

hostapd_interface_free: free hapd 0x9423f10

hostapd_cleanup_iface(0x9421720)

hostapd_cleanup_iface_partial(0x9421720)

hostapd_cleanup_iface: free iface=0x9421720

```

And the config file as a reference.

```
interface=wlp0s15f5u1u4

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

hw_mode=g

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

wmm_ac_vo_acm=0

eapol_key_index_workaround=0

eap_server=0

own_ip_addr=127.0.0.1

ssid=...

channel=1

wpa=3

wpa_passphrase=...

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP CCMP

rsn_pairwise=CCMP

accept_mac_file=/etc/hostapd/hostapd.accept

```

I'm not sure how to proceed from here. I'd appreciate any suggestions.

__

sol

----------

## solamour

My problem is gone now. First, I pulled out the USB WiFi device that I was using with hostapd and inserted it again, not particularly I knew what I was doing but just to make sure I didn't miss anything obvious. That didn't solve the problem, but it now gave me a different error message.

```
VLAN: vlan_set_name_type: SET_VLAN_NAME_TYPE_CMD name_type=2 failed: Package not installed
```

Quick research revealed that I needed CONFIG_VLAN_8021Q in the kernel, so I enabled the following. Not sure I really needed CONFIG_VLAN_8021Q_GVRP and CONFIG_VLAN_8021Q_MVRP, but well, I just enabled them while I was there.

```
Networking support

    Networking options

        802.1Q/802.1ad VLAN Support (CONFIG_VLAN_8021Q)

            GVRP (GARP VLAN Registration Protocol) support (CONFIG_VLAN_8021Q_GVRP)

            MVRP (Multiple VLAN Registration Protocol) support (CONFIG_VLAN_8021Q_MVRP)

```

I rebooted the system, and the newer version of hostapd worked just as well as the old one.

__

sol

----------

