Use wpa_cli in Fedora

Source: Internet
Author: User

When wpa_cli is used in fedora, the following error occurs:

$ wpa_cliwpa_cli v2.0Copyright (c) 2004-2012, Jouni Malinen <j@w1.fi> and contributorsThis software may be distributed under the terms of the BSD license.See README for more details.Interactive modeCould not connect to wpa_supplicant: (null) - re-trying

There are two possible causes:

1: not run with root permission

2: No control interface for/var/run/wpa_supplicant

Solution:

In/usr/lib/systemd/system/wpa_supplicant.service, add:-O/var/run/wpa_supplicant

In this way, when wpa_supplicant is started, the/var/run/wpa_supplicant control interface will be ready.

[Unit]Description=WPA Supplicant daemonBefore=network.targetAfter=syslog.target[Service]Type=dbusBusName=fi.w1.wpa_supplicant1EnvironmentFile=-/etc/sysconfig/wpa_supplicantExecStart=/usr/sbin/wpa_supplicant -u -f /var/log/wpa_supplicant.log -c /etc/wpa_supplicant/wpa_supplicant.conf -O /var/run/wpa_supplicant $INTERFACES $DRIVERS $OTHER_ARGS[Install]WantedBy=multi-user.target

Test:

Sudo killall wpa_supplicant

PS aux | grep wpa_supplicant

Root 3140 0.0 0.1 50748 2836? SS/usr/sbin/wpa_supplicant-u-F/var/log/wpa_supplicant.log-C/etc/wpa_supplicant/wpa_supplicant.conf
-O/var/run/wpa_supplicant-U-F/var/log/wpa_supplicant.log-P/var/run/wpa_supplicant.pid

Sudo LS-Al/var/run/wpa_supplicant/
Total 0
Drwxr-x ---. 2 root Root 60 Aug 21.
Drwxr-XR-X. 39 Root 1220 Aug 21 ..
Srwxrwx ---. 1 Root 0 Aug 21 00:17 wlp3s0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.