Linux

How to Install and Configure Nmcli

How to Install and Configure Nmcli

NetworkManager Command Line Interface (nmcli) is a powerful tool for managing network connections on Linux systems. This guide will walk you through the installation and configuration of nmcli to help you effectively manage your network settings.

Installation

On Ubuntu
Open the Terminal: You can find it in the application menu or by pressing Ctrl + Alt + T.

Update Package Index:

sudo apt update

Install NetworkManager:

sudo apt install network-manager

Install Nmcli: If NetworkManager is installed, nmcli is included by default. You can verify its installation by running:

nmcli –version

On Fedora
Open the Terminal.

Update Package Index:

sudo dnf check-update

Install NetworkManager:

sudo dnf install NetworkManager

Verify Installation:

nmcli –version

Basic Usage
Checking Network Status
To view your current network connections and their statuses, use:

nmcli device status

Connecting to a Wi-Fi Network
List Available Networks:

nmcli device wifi list

Connect to a Wi-Fi Network: Replace SSID with your network name and password with the network password.

nmcli device wifi connect SSID password ‘your_password’

Managing Network Connections
View Existing Connections:

nmcli connection show

Create a New Ethernet Connection:

nmcli connection add type ethernet con-name MyConnection ifname eth0

Modify an Existing Connection: To change the IP address, for example:

nmcli connection modify MyConnection ipv4.addresses 192.168.1.100/24

Activate a Connection:

nmcli connection up MyConnection

Deactivate a Connection:

nmcli connection down MyConnection

Additional Resources
For more detailed commands and options, refer to the official documentation:

NetworkManager Documentation
nmcli Manual Page

Conclusion

Nmcli is a versatile command-line tool that simplifies network management in Linux. By following this guide, you should be able to install and configure nmcli effectively. Explore the commands mentioned to familiarize yourself with managing network connections seamlessly.

If you have any questions or need further assistance, feel free to ask!

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button