5

I'm trying to enable wpa_supplicant on boot in Fedora 20. I created /etc/wpa_supplicant/wpa_supplicant.conf and am able to connect to my wireless network manually by running

wpa_supplicant -B -i wlan0 -Dwext -c /etc/wpa_supplicant/wpa_supplicant.conf

(I can confirm that I'm connected by running iwconfig)

I'm brand new to systemd and can't figure out how to get this to happen on boot. I've found guides for other distros that use systemd that say all you need to do is

systemctl enable wpa_supplicant@wlan0

but when I run that command, I get

Failed to issue method call: No such file or directory

Note: cross-posted on the official Fedora support forums, but haven't received any answers yet.

  • What is the content of the systemd unit that you created? And where are these "guides for other distros that use systemd"? I hardly think is all they say – Braiam Dec 11 '14 at 15:15
  • Are you positive you have a wlan0? Fedora doesn't use that naming scheme for network interfaces. – goldilocks Dec 11 '14 at 15:25
  • @Braiam I didn't create a systemd unit. According to the Arch Linux wiki on wpa_supplicant, "The wpa_supplicant package provides multiple systemd service files: wpa_supplicant.service [...] wpa_supplicant@.service - accepts the interface name as an argument and starts the wpa_supplicant daemon for this interface. It reads the configuration file in /etc/wpa_supplicant/wpa_supplicant-interface.conf. [...]" It seems you don't get all of these on Fedora. – ThisSuitIsBlackNot Dec 11 '14 at 16:26
  • 1
    Are you sure those exist in Fedora? If they don't you may need to create them like this – Braiam Dec 11 '14 at 16:48
  • The only one I see in systemctl list-units --all is wpa_supplicant.service, so I guess I'll have to create wpa_supplicant@.service. Not sure how I missed the page you linked to...that looks like exactly what I need, thank you. I'll give that a try later today. – ThisSuitIsBlackNot Dec 11 '14 at 16:57
3

Braiam suggested in the comments that if wpa_supplicant@wlan0 doesn't exist, I may need to create it myself, and also pointed me to a page in the Arch Linux wiki describing how to do so. I had to tweak things slightly for Fedora, but the following worked for me:

  1. Create a systemd unit, /etc/systemd/system/network-wireless@.service:

    [Unit]
    Description=Wireless network connectivity (%i)
    Wants=network.target
    Before=network.target
    BindsTo=sys-subsystem-net-devices-%i.device
    After=sys-subsystem-net-devices-%i.device
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    
    ExecStart=/usr/sbin/ip link set dev %i up
    ExecStart=/usr/sbin/wpa_supplicant -B -i %i -c /etc/wpa_supplicant/wpa_supplicant.conf
    #ExecStart=/usr/sbin/dhclient %i
    
    ExecStop=/usr/sbin/ip link set dev %i down
    
    [Install]
    WantedBy=multi-user.target
    

    Note that I had to change the paths to ip and wpa_supplicant from /usr/bin/ to /usr/sbin/ for my system. I also changed dhcpcd to dhclient, since I don't have dhcpcd installed.

  2. Create a symbolic link in /etc/systemd/system/multi-user.target.wants/:

    ln -s /etc/systemd/system/network-wireless@.service \
      /etc/systemd/system/multi-user.target.wants/network-wireless@wlan0.service
    

    I had to do this because running

    systemctl enable network-wireless@wlan0.service
    

    as described in the Arch Linux wiki failed with

    Failed to issue method call: No such file or directory
    
  3. Start the service:

    systemctl daemon-reload
    systemctl start network-wireless@wlan0.service
    

Now I'm able to connect to my wireless network on boot. I haven't figured out how to configure DHCP properly (hence the dhclient line being commented out in my systemd unit), but that's a different question.

0

I suspect that it returns the error "Failure to issue method call:.." because it cannot find the wlan0 interface. Are you sure that your wireless card is actually referred to as wlan0. Fedora introduced a new naming scheme with version 15, deviating from the usual ethX/wlanX naming for network devices: More specific information can be found in the wiki

Type the following commands in a shell to find the name of the wireless card (sample output shown below)

$ ifconfig
$ iwconfig

Sample outputs

wlp1s0    IEEE 802.11abg  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=200 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
lo        no wireless extensions.
p1p1      no wireless extensions.

here the wirelesscard is called wlp1s0

  • 1
    ifconfig and iwconfig both show wlan0. – ThisSuitIsBlackNot Dec 11 '14 at 16:23
  • @ThisSuitIsBlackNot glad you were able to solve the problem – Chrisii Dec 18 '14 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.