Categories: Ubuntu

How to Use nmcli in Ubuntu

Network manager manages all the network settings of the computer. With which network a machine should be connected, which type of traffic should be allowed and how to save data from the online servers are all managed by the network manager. Network managers have different tools, for example we have nm-connection-editor, nmcli, nm Gnome etc. All the tools or utilities have their own specific functions like nm-connection-editor is used to manage the wired connections of the machine, by Gnome settings we can manage all the network settings easily, by nmcli we can do the setting by the command line mode.
Sponsored

This write-up will demonstrate the installation of the network manager then in detail we will discuss the nmcli command for what purpose and how it can be used.

What is the installation procedure of Network Manager

Though the nmcli is installed by default in Ubuntu but in case if it is not installed we will install the network manager package. For the installation of the network manager we will first update our Ubuntu repository by opening the terminal and entering the following command for updating:

$ sudo apt update

Now we will install the network manager by using the following command.

$ sudo apt install network-manager

As it can be seen that the network manager is already installed. To start the network manager use:

$ sudo systemctl start network-manager

To confirm the above step we will check out the status of the network manager by using systemctl command as:

$ sudo systemctl status network-manager

What is nmcli

Sometimes we are managing the network setting by using the GUI (graphical user interface) but suddenly because of some issues the GUI crashes so we think about the other options to accomplish our results. An alternative to the GUI we have is command line methods. For the command line method we have the “nmcli” through which we can configure the network settings. There are different features which we can do by using this command. We will discuss them briefly.

nmcli command for General functions : Command nmcli can be used for the general functions like to check the status of wired connections for this purpose we used command as:

$ nmcli general status

We can also check the hostname by using this command:

$ nmcli general hostname

We can also check the permissions which are granted by the network manager as

$ nmcli general permissions

Sponsored

Nmcli command for the radio transmission control : We can check the status of the wifi whether it is on or off by the following command:

$ nmcli radio wifi

Nmcli command for monitoring : We can monitor the changes in different aspects like in connectivity state, devices using the nmcli command as:

$ nmcli monitor

If there some modifications made in the backend of network settings it will display them.

nmcli command for network management : We can manage the network setting using the nmcli command. In Ubuntu the configurations with the wireless devices are considered as connections.

We can display all the connections as:

$ nmcli connection show

We can also check the status of device by using the nmcli command:

$ sudo nmcli dev status

For more functions of nmcli command we can type man nmcli and the brief list will be available on Ubuntu:

Conclusion

The nmcli is the tool of the network manager mostly it is present in Ubuntu but in rare cases if it is not present then no need to panic we can still have it by installing the network manager package. In this write-up, we discussed the nmcli command and its functions briefly. Using the nmcli command we can check out the statuses of the wireless connections. We can also take a look at all the commands of nmcli by opening its manual through the “man” command. I Expect this writeup will make you understand the use of nmcli command.

Ubuntu Server Admin

Recent Posts

Cut data center energy costs with bare metal automation

Data centers are popping up everywhere. With the rapid growth of AI, cloud services, streaming…

10 hours ago

Build the future of *craft: announcing Starcraft Bounties!

Our commitment to building a thriving open source community is stronger than ever. We believe…

10 hours ago

NodeJS 18 LTS EOL extended from April 2025 to May 2032 on Ubuntu

The clock was ticking: Node.js 18’s upstream End of Life (EOL) The OpenJS Foundation is…

10 hours ago

Native integration now available for Pure Storage and Canonical LXD

June 25th, 2025 – Canonical, the company behind Ubuntu, and Pure Storage, the IT pioneer…

1 day ago

Revolutionizing Web Page Creation: How Structured Content is Slashing Design and Development Time

Co-authored with Julie Muzina A year ago, during our Madrid Engineering Sprint, we challenged ourselves…

2 days ago

Ubuntu Weekly Newsletter Issue 897

Welcome to the Ubuntu Weekly Newsletter, Issue 897 for the week of June 15 –…

3 days ago