Bug 985041
Summary: | wpa_supplicant dependency for NM prevents hostapd activation | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Gianluca Cecchi <gianluca.cecchi> | ||||
Component: | NetworkManager | Assignee: | Dan Williams <dcbw> | ||||
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 19 | CC: | bill, dcbw, emisca, junk, mhlavink, nightromantic, rh, zimon | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | x86_64 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2015-02-17 16:11:30 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Gianluca Cecchi
2013-07-16 15:49:55 UTC
(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 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 (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. 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 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. 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? 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". 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.) (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 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. 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. |