nmcli - easy wifi

NetworkManager makes it easy to use your computer’s wifi card.

Installation

sudo pacman -S networkmanager

Examples

nmcli is the command-line interface to NetworkManager

List Available Access Points

$ nmcli device wifi list
IN-USE  BSSID              SSID                         MODE   CHAN  RATE        SIGNAL  BARS  SECURITY    
        44:AD:D9:8E:40:DE  attwifi - Passpoint          Infra  40    195 Mbit/s  100     ▂▄▆█  WPA2 802.1X 
        44:AD:D9:8E:40:DD  Free PHL Airport WiFi        Infra  40    195 Mbit/s  100     ▂▄▆█  --

Connect to a new Access Point

$ nmcli device wifi connect 'attwifi - Passpoint' --ask
Password:
Device 'wlp2s0' successfully activated with '0a959c64-ebbd-4ba2-a813-f9f8fac2e3a3'

List Known/Active Access Points

$ nmcli connection
NAME                    UUID                                  TYPE  DEVICE 
Free PHL Airport WiFi   9aa5b767-78fc-4bfc-8612-eaf07305f54e  wifi  wlp2s0 
el_pro_downstairs_5GHz  2d8b7aea-13af-45ae-8004-a6845e3c36b0  wifi  --     
el_pro_upstairs_5GHz    7ecb663d-3f81-4964-b8df-ac49607d8eed  wifi  --     
Goog Hell               e1601da3-8647-4bde-8f6d-9f46e5a82624  wifi  --

Connect to a known Access Point

$ nmcli connection up 'Free PHL Airport WiFi'
Connection successfully activated (D-Bus active path: ...)

Disconnect from an Access Point

$ nmcli connection down 'Free PHL Airport WiFi'
Connection 'Free PHL Airport WiFi' successfully deactivated (D-Bus active path: ...)

Delete a known Access Point

$ nmcli connection delete 'Free PHL Airport WiFi'
Connection 'Free PHL Airport WiFi' (9aa5b767-78fc-4bfc-8612-eaf07305f54e) successfully deleted.

Disable/Enable Networking Entirely

Disable Networking

$ nmcli networking off
$ nmcli device
DEVICE          TYPE      STATE      CONNECTION 
wlp2s0          wifi      unmanaged  --         
p2p-dev-wlp2s0  wifi-p2p  unmanaged  --

Enable Networking

$ nmcli networking on
$ nmcli device
DEVICE          TYPE      STATE         CONNECTION 
wlp2s0          wifi      disconnected  --         
p2p-dev-wlp2s0  wifi-p2p  disconnected  --