Parobalth
  • Home
  • Categories
  • Tags
  • Archives

Nmcli: Command line interface for network-manager

Introduction¶

If you need wifi and a static IP I can recommend this approach from the debian wiki using wpa_supplicant.
If you need a more dynamic approach but still want or have to use the command line, there is a command line tool for network manager called nmcli. It is not very intuitive. I also had the problem that my Laptop has an internal wifi card and I had to configure a connection for an additional wifi usb dongle. Below the next headline are some useful commands I used to add a new connection and bring it up.
While writing this post I discovered some additional useful links I put at the end of this post.

Short summary of useful nmcli commands.¶

List status of available network interfaces:

nmcli device status

List wifi access-points:

nmcli device wifi list

Add a new connection named “foobar-home” for the network interface with the ifname wlx2824ff1a0227 and the ssid “foo”:

nmcli con add con-name foobar-home ifname wlx2824ff1a0227 type wifi ssid foo

Now we have to modify foobar-home to use wpa-psk:

nmcli con modify foobar-home wifi-sec.key-mgmt wpa-psk

Then we set the password “barbaz”:

nmcli con modify foobar-home wifi-sec.psk barbaz

Finally we bring the connection up: nmcli con up foobar-home

Interesting links I discovered while writing this post¶

  • This tutorial is very neat and straightforward.
  • Nmcli in the Archwiki.

If you have any questions, suggestions, thoughts and comments please feel free to email me.


License of this blog post:

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.


Published

Jul 24, 2019

Last Updated

Nov 17, 2019

Category

Computer

Tags

  • command-line 7
  • config 7
  • debian 11
  • network-manager 1
  • nmcli 1
  • wifi 3

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor