Skip to content

Click on each book below to review & buy on Amazon.

As an Amazon Associate, I earn from qualifying purchases.


CompTIA Linux+ XK0-005 - 1.5 - Interface Management: NetworkManager

In Linux, NetworkManager is a powerful tool that provides an intuitive command-line interface for managing network interfaces. It allows you to configure and control various network settings, such as IP addressing, DNS, and network connectivity. In this guide, we will explore the nmcli command, which is a command-line tool for managing NetworkManager. We'll cover some essential nmcli commands and their use cases.

Viewing Network Interfaces

To view the available network interfaces and their current status, you can use the following command:

nmcli device status

Example Output:

DEVICE   TYPE      STATE         CONNECTION
eth0     ethernet  connected     Wired Connection 1
wlan0    wifi      disconnected  --

Connecting to a Network

To establish a connection to a specific network, you can use the following command:

nmcli device wifi connect SSID password PASSWORD

Replace SSID with the name of the network you want to connect to, and PASSWORD with the corresponding password.

Configuring IP Address

You can assign a static IP address to a network interface using the following command:

nmcli connection modify DEVICE_NAME ipv4.addresses IP_ADDRESS/NETMASK

Replace DEVICE_NAME with the name of the interface you want to configure and IP_ADDRESS/NETMASK with the desired IP address and netmask in CIDR notation.

Managing Network Connections

To list all available network connections and their properties, use the following command:

nmcli connection show

Example Output:

NAME                  UUID                                  TYPE      DEVICE
Wired Connection 1    12345678-1234-1234-1234-123456789abc  ethernet  eth0
Wireless Connection 1 87654321-4321-4321-4321-987654321def  wifi      wlan0

Bringing up or down an Interface

To bring up or down a specific network interface, you can use the following commands:

nmcli device connect DEVICE_NAME
nmcli device disconnect DEVICE_NAME

Replace DEVICE_NAME with the name of the interface you want to manage.

Conclusion

NetworkManager, with its command-line tool nmcli, provides a convenient way to manage network interfaces in Linux. By using the nmcli commands covered in this guide, you can view interface information, connect to networks, configure IP addresses, manage network connections, and control interface states.

Remember, NetworkManager offers even more advanced features and configuration options. You can explore the official documentation and additional resources to further enhance your network management skills.


Support DTV Linux

Click on each book below to review & buy on Amazon. As an Amazon Associate, I earn from qualifying purchases.

NordVPN ®: Elevate your online privacy and security. Grab our Special Offer to safeguard your data on public Wi-Fi and secure your devices. I may earn a commission on purchases made through this link.