Bug 985041 - wpa_supplicant dependency for NM prevents hostapd activation
wpa_supplicant dependency for NM prevents hostapd activation
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: NetworkManager (Show other bugs)
19
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Dan Williams
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-16 11:49 EDT by Gianluca Cecchi
Modified: 2015-02-17 11:11 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-02-17 11:11:30 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
How I got hostapd working with WPA2 in my Fedora 20 system (1.24 KB, application/x-bzip2)
2014-04-15 08:35 EDT, zimon
no flags Details

  None (edit)
Description Gianluca Cecchi 2013-07-16 11:49:55 EDT
Description of problem:
I want to enable hostapd but it is not able to set my wireless card in AP mode

Version-Release number of selected component (if applicable):
NetworkManager-0.9.8.2-8.git20130709.fc19.x86_64
hostapd-2.0-1.fc19.x86_64
wpa_supplicant-2.0-3.fc19.x86_64

How reproducible:
always

Steps to Reproduce:
1. ethernet network configured with default NM
2. activate wireless
3. start hostapd

Actual results:

failure:
hostapd[10844]: nl80211: Failed to set interface wlp3s0 into AP mode

Expected results:
hostapd service started

Additional info:


[g.cecchi@ope46 ~]$ sudo systemctl start hostapd
[sudo] password for g.cecchi: 
Job for hostapd.service failed. See 'systemctl status hostapd.service' and 'journalctl -xn' for details.

[g.cecchi@ope46 ~]$ sudo journalctl -xn
-- Logs begin at Thu 2013-07-11 21:11:16 CEST, end at Tue 2013-07-16 17:42:40 CEST. --
Jul 16 17:42:15 ope46 sudo[10840]: g.cecchi : TTY=pts/0 ; PWD=/home/g.cecchi ; USER=root ; COMMAND=/bin/systemctl start h
Jul 16 17:42:15 ope46 systemd[1]: Starting Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator...
-- Subject: Unit hostapd.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit hostapd.service has begun starting up.
Jul 16 17:42:15 ope46 NetworkManager[438]: <info> (wlp3s0): supplicant interface state: inactive -> disabled
Jul 16 17:42:15 ope46 hostapd[10844]: Configuration file: /etc/hostapd/hostapd.conf
Jul 16 17:42:15 ope46 hostapd[10844]: nl80211: Failed to set interface wlp3s0 into AP mode
Jul 16 17:42:15 ope46 hostapd[10844]: nl80211 driver initialization failed.
Jul 16 17:42:15 ope46 systemd[1]: hostapd.service: control process exited, code=exited status=1
Jul 16 17:42:15 ope46 systemd[1]: Failed to start Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator.
-- Subject: Unit hostapd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
-- 
-- Unit hostapd.service has failed.
-- 
-- The result is failed.
Jul 16 17:42:15 ope46 systemd[1]: Unit hostapd.service entered failed state.


It seems wpa_supplicant service locks the wireless card.
In fact:

1) stop wpa_supplicant

2) NM immediately restarts it
[g.cecchi@ope46 ~]$ sudo systemctl stop wpa_supplicant

But as soon as I stop wpa, NetworkManager starts it again...

Jul 16 17:03:28 ope46 systemd[1]: Stopping WPA Supplicant daemon...
Jul 16 17:03:28 ope46 systemd[1]: Stopped WPA Supplicant daemon.
Jul 16 17:03:28 ope46 NetworkManager[438]: <info> wpa_supplicant stopped
Jul 16 17:03:28 ope46 NetworkManager[438]: <info> (wlp3s0): supplicant
interface state: disabled -> down
Jul 16 17:03:28 ope46 NetworkManager[438]: <info> (wlp3s0): device
state change: disconnected -> unavailable (reason 'supplicant-failed')
[30 20 10]
Jul 16 17:03:28 ope46 NetworkManager[438]: <info> (wlp3s0):
deactivating device (reason 'supplicant-failed') [10]
Jul 16 17:03:28 ope46 dbus-daemon[338]: dbus[338]: [system] Activating
via systemd: service name='fi.w1.wpa_supplicant1'
unit='wpa_supplicant.service'
Jul 16 17:03:28 ope46 dbus[338]: [system] Activating via systemd:
service name='fi.w1.wpa_supplicant1' unit='wpa_supplicant.service'
Jul 16 17:03:28 ope46 systemd[1]: Starting WPA Supplicant daemon...
Jul 16 17:03:28 ope46 dbus-daemon[338]: dbus[338]: [system]
Successfully activated service 'fi.w1.wpa_supplicant1'
Jul 16 17:03:28 ope46 dbus[338]: [system] Successfully activated
service 'fi.w1.wpa_supplicant1'
Jul 16 17:03:28 ope46 systemd[1]: Started WPA Supplicant daemon.
Jul 16 17:03:28 ope46 NetworkManager[438]: <info> wpa_supplicant started
Jul 16 17:03:28 ope46 kernel: [27885.321311] IPv6:
ADDRCONF(NETDEV_UP): wlp3s0: link is not ready
Jul 16 17:03:28 ope46 NetworkManager[438]: <info> (wlp3s0) supports 4 scan SSIDs
Jul 16 17:03:28 ope46 NetworkManager[438]: <warn> Trying to remove a
non-existant call id.
Jul 16 17:03:28 ope46 NetworkManager[438]: <info> (wlp3s0) supports 4 scan SSIDs
Jul 16 17:03:28 ope46 NetworkManager[438]: <info> (wlp3s0) supports 4 scan SSIDs
Jul 16 17:03:28 ope46 NetworkManager[438]: <info> (wlp3s0): supplicant
interface state: starting -> ready

3) temporarily mask and stop wpa_supplicant to be able to try hostapd

tons of messages like:
Jul 16 17:25:04 ope46 NetworkManager[438]: <error> [1373988304.394443] [nm-supplicant-interface.c:997] interface_add_cb(): (wlp3s0): error adding interface: Unit wpa_supplicant.service is masked.
Jul 16 17:25:04 ope46 NetworkManager[438]: dbus_g_proxy_cancel_call: assertion `pending != NULL' failed
Jul 16 17:25:04 ope46 NetworkManager[438]: <info> (wlp3s0): supplicant interface state: starting -> down
Jul 16 17:25:04 ope46 NetworkManager[438]: <warn> Trying to remove a non-existant call id.
Jul 16 17:25:04 ope46 dbus[338]: [system] Activating via systemd: service name='fi.w1.wpa_supplicant1' unit='wpa_supplicant.service'
Jul 16 17:25:04 ope46 dbus[338]: [system] Activation via systemd failed for unit 'wpa_supplicant.service': Unit wpa_supplicant.service is masked.

and system sucks in NetworkManager and journal:
top - 17:30:51 up  8:12,  7 users,  load average: 3.43, 2.57, 1.31
Tasks: 179 total,   5 running, 174 sleeping,   0 stopped,   0 zombie
%Cpu(s): 42.3 us, 31.6 sy,  0.0 ni, 25.4 id,  0.0 wa,  0.4 hi,  0.3 si,  0.0 st
KiB Mem:   8079764 total,  5558996 used,  2520768 free,   421748 buffers
KiB Swap: 10485756 total,        0 used, 10485756 free,  3435816 cached

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                            
  179 root      20   0 1528444  15940  15512 R  97.8  0.2   7:09.69 systemd-journal                                                    
  438 root      20   0  364916   8108   6332 R  63.2  0.1   4:31.12 NetworkManager    


4) start hostapd --> OK now

[g.cecchi@ope46 ~]$ sudo systemctl status hostapd
hostapd.service - Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
   Loaded: loaded (/usr/lib/systemd/system/hostapd.service; disabled)
   Active: active (running) since Tue 2013-07-16 17:23:54 CEST; 2min 45s ago
  Process: 10313 ExecStart=/usr/sbin/hostapd /etc/hostapd/hostapd.conf -P /run/hostapd.pid -B (code=exited, status=0/SUCCESS)
 Main PID: 10314 (hostapd)
   CGroup: name=systemd:/system/hostapd.service
           └─10314 /usr/sbin/hostapd /etc/hostapd/hostapd.conf -P /run/hostapd.pid -B

Jul 16 17:23:54 ope46 systemd[1]: Starting Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator...
Jul 16 17:23:54 ope46 systemd[1]: Started Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator.
Jul 16 17:24:46 ope46 hostapd[10314]: wlp3s0: STA c8:60:00:12:1f:97 IEEE 802.11: authenticated
Jul 16 17:24:46 ope46 hostapd[10314]: wlp3s0: STA c8:60:00:12:1f:97 IEEE 802.11: associated (aid 1)
Jul 16 17:24:46 ope46 hostapd[10314]: wlp3s0: STA c8:60:00:12:1f:97 RADIUS: starting accounting session 51E5658A-00000000
Jul 16 17:24:46 ope46.ceda.polimi.it hostapd[10314]: wlp3s0: STA c8:60:00:12:1f:97 WPA: pairwise key handshake completed (RSN)


5) verify a wireless client can connect to this newly create AP
OK. client able to connect and surf.


So I would like to be able to prevent NM to watch against wpa_supplicant.
So that I'm able to use hostapd.

Gianluca
Comment 1 Alexey Kazakov 2013-07-26 05:27:19 EDT
(In reply to Gianluca Cecchi from comment #0)
> So I would like to be able to prevent NM to watch against wpa_supplicant.
> So that I'm able to use hostapd.

Gianluca,
I tried to use hostapd and encountered the same problem, found your discussion of it here http://fedora.12.x6.nabble.com/hostapd-and-fedora19-wifi-hotspot-td5009691.html -- thanks, you got me going in right direction (I hope ;-)

A bit more research provided this solution:
add to /etc/NetworkManager/NetworkManager.conf:

[keyfile]
unmanaged-devices=mac:AA:11:22:33:44:BB   # mac of your wireless card here

This prevents NetworkManager from managing device with mac address you provide.

I blacklisted my wireless card, hostapd started and worked as intended.
Don't know if this is the correct solution, but at least it works.

Cheers,
Night Romantic
Comment 2 Emilio Scalise 2013-08-07 04:59:45 EDT
I have the same problem with my Intel Corporation Centrino Wireless-N 2200 (rev c4).

I configured the workaround from previous post and hostapd works again.

What about client wifi connections from networkmanager? Is it possible to continue using them?
Do I have to change networkmanager configuration, restart it every time I need AP mode with hostapd?

What changed in F19, since that didn't happen in F17 (my system was updated yesterday from F17 using fedup)?

Thanks
Comment 3 Alexey Kazakov 2013-08-07 05:28:45 EDT
(In reply to Emilio Scalise from comment #2)
> What about client wifi connections from networkmanager? Is it possible to
> continue using them?

As far as I can see, NetworkManager remembers your client connections and you can use them *when you wireles card is managed by NetworkManager*.

> Do I have to change networkmanager configuration, restart it every time I
> need AP mode with hostapd?

Have checked right now: there's no need to restart NM, I comment (or uncomment) "unmanaged-devices=..." line and almost immediately NM sees the change.

It'll be easy to write a simple script that comments/uncomments mentioned line to make the process of switching more convenient.

As for what changed -- I'd say it's something in a way NM works with wireless adapters (or all network adapters), maybe you can find some clues in NM changelog.
Comment 4 Gianluca Cecchi 2013-09-10 08:12:00 EDT
Sorry for the delay in my feedback.
But in my case it doesn't work. What is the sequence of steps you made to have hostapd running AND not having /var/log/messages flood with warnings?

In my case the new NetworkManager.conf is 
[main]
plugins=ifcfg-rh,keyfile
# do allow hostapd you have to uncomment following "unmanaged-devices ... " line
[keyfile]
unmanaged-devices=mac:74:2f:68:83:88:df   # mac of your wireless card here

Originally it was:
[main]
plugins=ifcfg-rh

And even after restarting NetworkManager I keep getting wpa_supplicant automatically started and preventing so hostapd to manage my wireless card.


Thanks,
Gianluca
Comment 5 Alexey Kazakov 2013-09-10 09:29:37 EDT
Gianluca,

I checked my NetworkManager.conf -- I haven't changed "plugins=ifcfg-rh" to "plugins=ifcfg-rh,keyfile" in the [main] section, maybe that's the reason it doesn't work in your case?

I.e. try this in you /etc/NetworkManager/NetworkManager.conf:

[main]
plugins=ifcfg-rh
# do allow hostapd you have to uncomment following "unmanaged-devices ... " line
[keyfile]
unmanaged-devices=mac:74:2f:68:83:88:df   # mac of your wireless card here

hostaptd worked fine in my case (though I haven't used it that much since). And as I wrote in сomment 3, I even didn't have to restart NetworkManager for the change to take effect.
Comment 6 Gianluca Cecchi 2013-09-10 10:08:32 EDT
Possibly I misread man page for NetworkManager.conf
But setting config file to 
 
[main]
plugins=ifcfg-rh
# do allow hostapd you have to uncomment following "unmanaged-devices ... " line
unmanaged-devices=mac:74:2f:68:83:88:df   # mac of your wireless card here

when I start the wireless card still it stays managed by wpa_supplicant and if I stop it, it is restarted by NetworkManager and hostapd returns error....

NetworkManager-0.9.8.2-8.git20130709.fc19.x86_64
kernel 3.10.10-200.fc19.x86_64

Redone these steps:
- stop wifi
Sep 10 15:59:33 ope46 NetworkManager[10066]: <info> (wlp3s0): device state change: disconnected -> unavailable (reason 'none') [30 20 0]
Sep 10 15:59:33 ope46 NetworkManager[10066]: <info> (wlp3s0): deactivating device (reason 'none') [0]
Sep 10 15:59:33 ope46 NetworkManager[10066]: <info> WiFi hardware radio set disabled
Sep 10 15:59:33 ope46 NetworkManager[10066]: <info> WiFi now disabled by radio killswitch
Sep 10 15:59:33 ope46 gnome-session[1423]: JS LOG: Removing an access point that was never added
Sep 10 15:59:33 ope46 gnome-session[1423]: JS LOG: Removing an access point that was never added
Sep 10 15:59:33 ope46 gnome-session[1423]: JS LOG: Removing an access point that was never added
Sep 10 15:59:33 ope46 gnome-session[1423]: JS LOG: Removing an access point that was never added

lshw command shows:
...
           *-network DISABLED
                description: Wireless interface
                product: AR9285 Wireless Network Adapter (PCI-Express)
                vendor: Qualcomm Atheros
                physical id: 0
                bus info: pci@0000:03:00.0
                logical name: wlp3s0
                version: 01
                serial: 74:2f:68:83:88:df
                width: 64 bits
                clock: 33MHz
                capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
                configuration: broadcast=yes driver=ath9k driverversion=3.10.10-200.fc19.x86_64 firmware=N/A latency=0 link=no multicast=yes wireless=IEEE 802.11bgn
                resources: irq:17 memory:ddc00000-ddc0ffff
..

- changed file

- restart NetworkManager
Sep 10 16:01:48 ope46 systemd[1]: Stopping Network Manager...
Sep 10 16:01:48 ope46 NetworkManager[10066]: <info> caught signal 15, shutting down normally.
Sep 10 16:01:48 ope46 NetworkManager[10066]: <info> (wlp3s0): device state change: unavailable -> unmanaged (reason 'removed') [20 1
0 36]
Sep 10 16:01:48 ope46 NetworkManager[10066]: <info> (wlp3s0): cleaning up...
Sep 10 16:01:48 ope46 NetworkManager[10066]: <info> exiting (success)
Sep 10 16:01:48 ope46 systemd[1]: Starting Network Manager...
Sep 10 16:01:48 ope46 gnome-session[1423]: Window manager warning: Log level 16: gsignal.c:2593: instance `0x56395e0' has no handler
 with id `269794'
Sep 10 16:01:48 ope46 gnome-session[1423]: Window manager warning: Log level 16: gsignal.c:2593: instance `0x56395e0' has no handler
 with id `269792'
Sep 10 16:01:48 ope46 gnome-session[1423]: Window manager warning: Log level 16: gsignal.c:2593: instance `0x56395e0' has no handler
 with id `269793'
Sep 10 16:01:48 ope46 NetworkManager[12210]: <info> NetworkManager (version 0.9.8.2-8.git20130709.fc19) is starting...
Sep 10 16:01:48 ope46 NetworkManager[12210]: <info> Read config file /etc/NetworkManager/NetworkManager.conf
Sep 10 16:01:48 ope46 NetworkManager[12210]: <info> WEXT support is enabled
Sep 10 16:01:48 ope46 NetworkManager[12210]: <info> VPN: loaded org.freedesktop.NetworkManager.openvpn
Sep 10 16:01:48 ope46 NetworkManager[12210]: <info> VPN: loaded org.freedesktop.NetworkManager.openconnect
Sep 10 16:01:48 ope46 NetworkManager[12210]: <info> VPN: loaded org.freedesktop.NetworkManager.pptp
Sep 10 16:01:48 ope46 NetworkManager[12210]: <info> VPN: loaded org.freedesktop.NetworkManager.vpnc
Sep 10 16:01:48 ope46 NetworkManager[12210]: <info> VPN: loaded org.freedesktop.NetworkManager.l2tp
Sep 10 16:01:48 ope46 NetworkManager[12210]:    ifcfg-rh: Acquired D-Bus service com.redhat.ifcfgrh1
Sep 10 16:01:48 ope46 NetworkManager[12210]: <info> Loaded plugin ifcfg-rh: (c) 2007 - 2010 Red Hat, Inc.  To report bugs please use
 the NetworkManager mailing list.
Sep 10 16:01:48 ope46 NetworkManager[12210]: <info> Loaded plugin keyfile: (c) 2007 - 2010 Red Hat, Inc.  To report bugs please use 
the NetworkManager mailing list.
...
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> rfkill2: found WiFi radio killswitch (at /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/ieee80211/phy0/rfkill2) (driver ath9k)
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> rfkill0: found WiFi radio killswitch (at /sys/devices/platform/asus-nb-wmi/rfkill/rfkill0) (platform driver asus-nb-wmi)
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> WiFi hardware radio set disabled
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> WiFi disabled by radio killswitch; disabled by state file
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> WWAN enabled by radio killswitch; enabled by state file
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> WiMAX enabled by radio killswitch; enabled by state file
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> Networking is enabled by state file
Sep 10 16:01:49 ope46 systemd[1]: Started Network Manager.
Sep 10 16:01:49 ope46 systemd[1]: Starting Network Manager Wait Online...
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> (wlp3s0): using nl80211 for WiFi device control
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> (wlp3s0): driver supports Access Point (AP) mode
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> (wlp3s0): new 802.11 WiFi device (driver: 'ath9k' ifindex: 3)
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> (wlp3s0): exported as /org/freedesktop/NetworkManager/Devices/0
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> (wlp3s0): device state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> (wlp3s0): bringing up device.
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> (wlp3s0): deactivating device (reason 'managed') [2]
Sep 10 16:01:49 ope46 NetworkManager[12210]: <warn> failed to allocate link cache: (-10) Operation not supported
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> (p5p1): carrier is ON
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> (p5p1): new Ethernet device (driver: 'atl1c' ifindex: 2)
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> (p5p1): exported as /org/freedesktop/NetworkManager/Devices/1
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> (p5p1): device state change: unmanaged -> unavailable (reason 'connection-assumed') [10 20 41]
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> (p5p1): preparing device.
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> Activation (p5p1) starting connection 'p5p1'
Sep 10 16:01:49 ope46 NetworkManager[12210]: (nm-device.c:3894):nm_device_activate: runtime check failed: (priv->state == NM_DEVICE_STATE_DISCONNECTED)
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> (p5p1): device state change: unavailable -> ip-config (reason 'none') [20 70 0]
Sep 10 16:01:49 ope46 NetworkManager[12210]: <warn> /sys/devices/virtual/net/lo: couldn't determine device driver; ignoring...
Sep 10 16:01:49 ope46 NetworkManager[12210]: <warn> failed to allocate link cache: (-10) Operation not supported
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> (virbr0): ignoring bridge not created by NetworkManager
Sep 10 16:01:49 ope46 NetworkManager[12210]: <warn> /sys/devices/virtual/net/virbr0-nic: couldn't determine device driver; ignoring...
Sep 10 16:01:49 ope46 NetworkManager[12210]: <warn> /sys/devices/virtual/net/vnet0: couldn't determine device driver; ignoring...
Sep 10 16:01:49 ope46 NetworkManager[12210]: <warn> /sys/devices/virtual/net/lo: couldn't determine device driver; ignoring...
Sep 10 16:01:49 ope46 NetworkManager[12210]: <warn> failed to allocate link cache: (-10) Operation not supported
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> (virbr0): ignoring bridge not created by NetworkManager
Sep 10 16:01:49 ope46 NetworkManager[12210]: <warn> /sys/devices/virtual/net/virbr0-nic: couldn't determine device driver; ignoring...
Sep 10 16:01:49 ope46 NetworkManager[12210]: <warn> /sys/devices/virtual/net/vnet0: couldn't determine device driver; ignoring...
Sep 10 16:01:49 ope46 NetworkManager[12210]: <warn> (p5p1) firewall zone add/change failed: (32) ZONE_ALREADY_SET
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> Activation (p5p1) Stage 3 of 5 (IP Configure Start) scheduled.
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> Activation (p5p1) Stage 3 of 5 (IP Configure Start) started...
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> Activation (p5p1) Beginning DHCPv4 transaction (timeout in 45 seconds)
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> dhclient started with pid 12219
Sep 10 16:01:49 ope46 NetworkManager[12210]: <info> Activation (p5p1) Stage 3 of 5 (IP Configure Start) complete.

- start wifi
Sep 10 16:04:19 ope46 NetworkManager[12210]: <info> (wlp3s0): bringing up device.
Sep 10 16:04:19 ope46 NetworkManager[12210]: <info> WiFi hardware radio set enabled
Sep 10 16:04:23 ope46 NetworkManager[12210]: <info> WiFi now enabled by radio killswitch
Sep 10 16:04:23 ope46 NetworkManager[12210]: <info> (wlp3s0): bringing up device.
Sep 10 16:04:23 ope46 kernel: [26510.487427] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready
Sep 10 16:04:23 ope46 NetworkManager[12210]: <info> (wlp3s0) supports 4 scan SSIDs
Sep 10 16:04:23 ope46 NetworkManager[12210]: <info> (wlp3s0): supplicant interface state: starting -> ready
Sep 10 16:04:23 ope46 NetworkManager[12210]: <info> (wlp3s0): device state change: unavailable -> disconnected (reason 'supplicant-available') [20 30 42]
Sep 10 16:04:23 ope46 NetworkManager[12210]: <warn> Trying to remove a non-existant call id.
Sep 10 16:04:23 ope46 NetworkManager[12210]: <info> (wlp3s0): supplicant interface state: ready -> disconnected
Sep 10 16:04:23 ope46 NetworkManager[12210]: <info> (wlp3s0) supports 4 scan SSIDs
Sep 10 16:04:24 ope46 NetworkManager[12210]: <info> (wlp3s0): supplicant interface state: disconnected -> inactive

- start hostapd
[g.cecchi@ope46 ~]$ sudo systemctl start hostapd
Job for hostapd.service failed. See 'systemctl status hostapd.service' and 'journalctl -xn' for details.

In messages
Sep 10 16:04:59 ope46 systemd[1]: Starting Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator...
Sep 10 16:04:59 ope46 NetworkManager[12210]: <info> (wlp3s0): supplicant interface state: inactive -> disabled
Sep 10 16:04:59 ope46 hostapd[12280]: Configuration file: /etc/hostapd/hostapd.conf
Sep 10 16:04:59 ope46 hostapd[12280]: nl80211: Failed to set interface wlp3s0 into AP mode
Sep 10 16:04:59 ope46 hostapd[12280]: nl80211 driver initialization failed.
Sep 10 16:04:59 ope46 systemd[1]: hostapd.service: control process exited, code=exited status=1
Sep 10 16:04:59 ope46 systemd[1]: Failed to start Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator.
Sep 10 16:04:59 ope46 systemd[1]: Unit hostapd.service entered failed state.

[g.cecchi@ope46 ~]$ sudo ifconfig wlp3s0
wlp3s0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 74:2f:68:83:88:df  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Could it depend on having some wifi defined connection in NetworkManager and this way it has to manage the card anyway?
Do you have any wifi connection defined in NetworkManager?
Comment 7 Bill Gradwohl 2013-10-10 14:10:49 EDT
I'm just starting to play with hostapd and discovered it won't work unless I manually restart hostapd.service and then restart dnsmasq.service after the boot process is over.

I then also have to manually provide the interface with an IP address (via ifconfig wlp2s0 up 10.0.0.1 netmask 255.255.255.0) as hostapd won't provide one and it appears dnsmasq won't either even though I added the mac address of the wireless NIC to the dnsmasq.conf file.

As delivered, hostapd isn't usable under "normal" circumstances.

Also, as a hotspot, there is no ifcfg-XXX file, so there is no way to set the required ZONE property that firewalld wants. This means there's no way to have firewalld manage that interface. Gigantic FAIL!

How are folks supposed to use hostapd via systemd when the normal control flow won't assign an IP address to the wireless NIC. How is systemd supposed to be used without resorting to scripting this stuff manually? 

Sure, I can write the script, but many folks can't and they shouldn't have to. It should "Just work".
Comment 8 zimon 2014-04-15 08:35:38 EDT
Created attachment 886462 [details]
How I got hostapd working with WPA2 in my Fedora 20 system


Any good reason, why in NetworkManager hotspot feature there is no WPA2-support? Just simple insecure useless WEP, which didnt even work for me, and overall the NM settings then break hostapd so badly the WLAN device has to be blacklisted from the NM. 

Anyway, I got it working here also. Below are the steps for me and the config files and the script to /usr/local/sbin/ are attached:

(At first. 0) would be easier if the wlan-device wlp0s29u1u6 was called just wlan0. This can be done, but I noticed it was not persistent over reboots, so I won't bother.
# ln -f -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules


1) Blacklisted my WLAN-network device in /etc/NetworkManager/NetworkManager.conf adding the lines:
"
[keyfile]
unmanaged-devices=mac:00:0c:43:00:xx:xx
"

2) Restarted NetworkManager and see in the GNOME settings WLAN is no longer managed there:
systemctl restart NetworkManager

3) Configured /etc/hostapd.conf to have everything ok
(conf file attached)

4) checked the WLAN device and driver supports master and AP mode. Check.
# iwconfig wlp0s29u1u6 mode master
Also there is page of AP-enabled WLAN-devices found. Not all are supported.

5) Wrote a script to /usr/local/sbin/start_hostapd.sh
(shell script attached)

6) Configured /etc/dnsmasq.d/wlan-ap.conf
(config file attached)

7) Run the script (5).

=> IT WORKS. Devices can connect after giving the right password, they get their dynamic private IP and their data is routed to and from the Internet.

Also later the AP can be made invisible if one wants:
"ignore_broadcast_ssid=1" to hostapd.conf

All config files and the script, 4 files in total, is attached as a .tar.bz2-file. There is comments in the files, which you must edit if you use them, like: wlan-device names, ip-address ranges, AP-ssid-names and stuff. Also in the start of the each file is the location where the file should be placed in the filesystem hierarchy. (Disclaimer: it worked for me. I havent rebooted yet to see if it works still then or if I forgot to mention some step in the middle.)
Comment 9 Alexey Kazakov 2014-04-15 10:33:52 EDT
(In reply to zimon from comment #8)
Thanks for the info and the scripts, zimon!

As far as I can see step 2 is unnecessary: when you save /etc/NetworkManager/NetworkManager.conf NetworkManager reacts almost immediately and without restart.

Regarding script (5), firewalld and iptables rules, masquerading and such, you may also want to check this link:

https://unix.stackexchange.com/questions/107420/fedora-20-wifi-hotspot-almost-work-but-something-wrong
Comment 10 Fedora End Of Life 2015-01-09 13:57:01 EST
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 11 Fedora End Of Life 2015-02-17 11:11:30 EST
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.