Linux - Network Manager (nmcli) command line

Linux - Network Manager (nmcli) command line

Posted By: pmietlicki

Published to Linux on Jun 04, 2015

Retrieve interface information :

sudo nmcli dev list

List configured networks (the configuration is inside /etc/NetworkManager/system-connections) :

sudo nmcli con list

It allows to know the UUID of your connection.

Enable / Disable a connection :

sudo nmcli con up id nom-de-votre-connexion
sudo nmcli con up uuid uuid-de-votre-connexion

Display informations about your active connections :

sudo nm-tool

This command returns more comprehensive information than ifconfig.

Delete a connection and configuration :

sudo nmcli con delete id nom-de-votre-connexion
sudo nmcli con delete uuid uuid-de-votre-connexion

Configuration example (inside /etc/NetworkManager/system-connections) :
WiFi file

[connection]
id=Wifi
uuid=7439b648-7344-4b3d-b0ba-0461a89f7668
type=802-11-wireless
autoconnect=true
timestamp=1357596861<br>
[802-11-wireless]
ssid=YourSSID
mode=infrastructure
security=802-11-wireless-security
[802-11-wireless-security]
key-mgmt=wpa-psk
psk=YourWifiWPAPassword

Ethernet file

[connection]
id=Ethernet
uuid=7439b648-7344-4b3d-b0ba-0461a89f7668
type=802-3-ethernet
timestamp=1357596861
[ipv4]
method=auto

To know

If it still does not work, this may be due to a DNS configuration problem.
For example, try to use the Google DNS:

  • DNS server : 8.8.8.8
  • Search domain : 8.8.4.4


Tags: Network, nmcli, WiFi

Archive