Skip to content

Instantly share code, notes, and snippets.

@gustavorps
Last active August 29, 2015 14:27
Show Gist options
  • Save gustavorps/3c9554041d1c2f5aebf7 to your computer and use it in GitHub Desktop.
Save gustavorps/3c9554041d1c2f5aebf7 to your computer and use it in GitHub Desktop.
Linux - Tips, Tricks and FAQ

Linux - Tips, Tricks and FAQ

Network Manager

WiFi manager from command line

Debian and Ubuntu Based

nmcli is a command‐line tool for controlling NetworkManager.

Lsting available Wi-Fi APs

$ nmcli device wifi list

This command shows how to list available Wi-Fi networks (APs). You can also use --fields option for displaying different columns. nmcli -f all dev wifi list will show all of them.

SSID               MODE    CHAN  RATE       SIGNAL  BARS  SECURITY
netdatacomm_local  Infra   6     54 Mbit/s  37      ▂▄__  WEP
F1                 Infra   11    54 Mbit/s  98      ▂▄▆█  WPA1
LoremCorp          Infra   1     54 Mbit/s  62      ▂▄▆_  WPA2 802.1X
Internet           Infra   6     54 Mbit/s  29      ▂___  WPA1
HPB110a.F2672A     Ad-Hoc  6     54 Mbit/s  22      ▂___  --
Jozinet            Infra   1     54 Mbit/s  19      ▂___  WEP
VOIP               Infra   1     54 Mbit/s  20      ▂___  WEP
MARTINA            Infra   4     54 Mbit/s  32      ▂▄__  WPA2
N24PU1             Infra   7     11 Mbit/s  22      ▂___  --
alfa               Infra   1     54 Mbit/s  67      ▂▄▆_  WPA2
bertnet            Infra   5     54 Mbit/s  20      ▂___  WPA1 WPA2

Disconnect from a WiFi BSSID:

$ nmcli d disconnect iface wlan0

Connect to a WiFI BSSID:

$ nmcli d wifi connect 'WIFI_NET_BBSID_OR_NAME' password 'WIFI_PASSWORD' iface wlan0

Just change wlan0, WIFI_NET_BBSID_OR_NAME, WIFI_PASSWORD to reflect your setup.

Connect to WiFi already saved

$ nmcli c down id 'WI_FI_CONNECTION'

and

$ nmcli c up id 'WI_FI_CONNECTION'

WI_FI_CONNECTION is the name of connection as it was save in NetworkManager (Check nmcli c).

Reference: man nmcli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment