Ask Your Question
1

How to connect to wifi using nmcli?

asked 2015-02-21 22:41:09 -0500

riclags gravatar image

updated 2015-03-01 05:25:24 -0500

I installed Fedora Server on my computer and I want to connect to a WiFi network but I am confused on how to use nmcli command.

My interfaces, I suspect that wireless interface is down:

$ ip addr
...
3: wlp3s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:16:cf:b9:a4:cd brd ff:ff:ff:ff:ff:ff

My configured connections:

$ nmcli con show
NAME      UNAME           TYPE               DEVICE
wpl3s0    63e04cee-...    802-11-wireless    --

The status of devices:

$ nmcli dev status
DEVICE    TYPE    STATE        CONNECTION
wlp3s0    wifi    unmanaged    --

I do a nmcli dev wifi list but no results. The command nmcli radio wifi gives enabled. I then try doing:

$ sudo ifup wlp3s0
Error: no device found for connection 'wlp3s0'

So how do I assign a device to connection 'wlp3s0'?

Also, I am not even sure if I'm doing the right thing so please enlighten me.

Updates: 2015-03-01

I still haven't figured this out so I tried connecting to WiFi manually (without using the nmcli tool).

$ sudo ip link set dev wlp3s0 up        # bring up the 'wlp3s0' interface
$ sudo iwconfig wlp3s0                  # check interface
wlp3s0    IEEEE 802.11abgn  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated    Tx-Power=17 dBm
          Retry short limit:7    RTS thr:off    Fragment thr:off
          Encryption key:off
          Power Management:off
$ sudo iwlist wlp3s0 scanning           # scan for ESSID; it finds "my-ssid"
wlp3s0    Scan completed :
          Cell 01 - Address: ...
                    ...
                    ESSID:"my-ssid"
                    ...
$ sudo wpa_passphrase "my-ssid" > wpa_config_file
sudo: wpa_passphrase: command not found
$ which wpa_supplicant
/usr/bin/which: no wpa_supplicant in (/usr/local/bin:/usr/bin/usr/local/sbin:/usr/sbin:...)

Could the lack of wpa_supplicant be the reason I can't connect? And why isn't this installed by default? How do I install it if I can't connect to the Internet? Any help is appreciated.

edit retag flag offensive close merge delete

Comments

strange statement yours, if you can write here you are connected (friends, uffico, mobile). uses this connection to download the installation dvd and after:

yum localinstall [path of rpm file]

mclmmc gravatar imagemclmmc ( 2015-03-02 11:10:50 -0500 )edit

I am facing similar issue :(

sagarun gravatar imagesagarun ( 2015-03-06 22:39:50 -0500 )edit

What worked for me was to install wpa_supplicant and NetworkManager-wifi

Kakao gravatar imageKakao ( 2015-06-14 15:21:22 -0500 )edit

6 Answers

Sort by » oldest newest most voted
0

answered 2015-02-24 09:53:42 -0500

covex gravatar image

If this is unmanaged by NM there may be some reason behind it like the device is not working properly.

Try to see:

journalctl -r -u NetworkManager.service

If wifi is ok, just unmanaged, then ifup may not be the best tool to use as this is only a bash script wrapping the configs in /etc/sysconfig/networking, try commands like

ifconfig wlp3s0 up
iwconfig wlp3s0

For nmcli check http://fedoraproject.org/wiki/Networking/CLI

edit flag offensive delete link more

Comments

Output of journalctl -r -u NetworkManager.service:

... (wlp3s0): exported as /org/freedesktop/NetworkManager/Devices/2
... (wlp3s0): new Generic device (driver: 'ath9k' ifindex: 3)
... (wlp3s0): carrier is OFF
... (wlp3s0): 'wifi' plugin not available; creating generic device

Not sure what to make of that...

riclags gravatar imagericlags ( 2015-02-25 09:29:03 -0500 )edit

yum install NetworkManager-wifi

covex gravatar imagecovex ( 2015-02-26 12:44:57 -0500 )edit

I can't. I'm not connected to the Internet so it throws an error when I do any yum <command>...

riclags gravatar imagericlags ( 2015-03-01 05:07:03 -0500 )edit
0

answered 2015-03-02 05:27:49 -0500

MJG gravatar image

To check whether your wifi card is on and working at all, I suggest you do

iwlist wlp3s0 scan

That will also show you whether your box sees your wifi network, and its networkname. If that works, you can add a connection with

nmcli conn add <parameters>

where for the specific parameters I suggest to consult the man page of nmcli. It will probably be something like:

nmcli conn add type wifi con-name <connectionname> ifname wlp3s0 ssid <wifinetworkname>

After that you can bring it up with

nmcli conn up <connectionname>
edit flag offensive delete link more

Comments

I already did this an I get an Error: no device found for connection 'my-connection'. How do I associate a DEVICE to my connection (as I've mentioned in my question, the DEVICE column shows a -- under 'my-connection')?

riclags gravatar imagericlags ( 2015-03-03 08:07:29 -0500 )edit
0

answered 2016-05-11 23:02:16 -0500

I finally found the problem, wpa_supplicant was not running.

Try this: sudo systemctl start wpa_supplicant.service

Now check the wifi list again: nmcli dev wifi list

Connect to the network like this: nmcli --ask connection up

edit flag offensive delete link more

Comments

I'm running CentOS 7, minimal install, on a System76 laptop and was seeing the same error messages when running all the same commands. This solution worked for me. Thank you!

rebeccajcoleman gravatar imagerebeccajcoleman ( 2017-08-18 09:52:32 -0500 )edit
0

answered 2015-10-24 11:01:03 -0500

I had a similar problem setting up a CentOS 7 minimal install on an old Gateway netbook. The netbook has only a wireless card (no ethernet port) so, like riclags, I couldn't install the NetworkManager-wifi package.

A USB-2-to-Ethernet adapter solved my problem instantly. I wasn't certain that the new hardware would be recognized by Linux, but it was. I connected the netbook to an Ethernet port on my WAP; it was automatically added as a new device and connection, and I was in! Five minutes later, I had installed Network-Manager-wifi, and I had wireless access, too. The adapter cost all of $9.99 on Amazon. Hope that info will help someone!

edit flag offensive delete link more
0

answered 2016-02-24 07:22:42 -0500

jsedlak gravatar image

Check whether you aren't missing wifi plugin for NetworkManager, run dnf install NetworkManager-wifi.

edit flag offensive delete link more
0

answered 2017-02-24 16:41:12 -0500

root@HDscania# nmcli d DEVICE TYPE STATE CONNECTION lo loopback unmanaged -- root@HDscanisa# iwlist iwlwifi scan && iwlist wlp1s0 scan iwlwifi Interface doesn't support scanning. wlp1s0 Interface doesn't support scanning root@HDscania: lspci -vv | grep Wireless 01:00.0 Network controller: Intel™ Centrino wireless-N 130 rev 34 Subsystem: Intel™ Centrino wireless-N 130 BGN Kernel modules: iwlwifi root@HDscania: ifconfig iwlwifi up iwlwifi: ERROR while getting interface flags: No such device root@HDscania: ifconfig wlp1s0 up wlp1s0: ERROR while getting interface flags: No such device

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2015-02-21 22:41:09 -0500

Seen: 42,319 times

Last updated: Mar 02 '15