Network Manager and NMCLI
*Network Manager* is a system service in Linux designed to simplify the management of network connections. It provides a consistent interface for configuring and managing various types of network connections, including Ethernet, Wi-Fi, VPN, and mobile broadband. Network Manager can operate through graphical user interfaces (GUIs) as well as command-line tools.
*NMCLI* (Network Manager Command Line Interface) is the command-line tool for interacting with Network Manager. It allows users to configure and manage network connections, check connection status, and troubleshoot networking issues without a graphical interface.
Key Features of Network Manager
1. **Automatic Connection Management**: Automatically connects to known networks based on predefined settings.
2. **Multiple Connection Types**: Supports Ethernet, Wi-Fi, VPN, DSL, and more.
3. **User-Friendly Interface**: Provides both GUI and command-line interfaces for configuration.
4. **Dynamic Configuration**: Allows for real-time changes to network configurations without requiring a system restart.
5. **Integration with Systemd**: Works seamlessly with systemd for managing services and dependencies.
NMCLI Commands
#### *1. Viewing Connection Status*
To check the status of all network connections:
```bash
nmcli connection show
```
To view active connections:
```bash
nmcli connection show --active
```
#### *2. Managing Connections*
**Creating a New Connection**:
For example, to create a new Ethernet connection:
```bash
nmcli connection add type ethernet ifname eth0 con-name MyEthernet
```
**Modifying an Existing Connection**:
```bash
nmcli connection modify MyEthernet ipv4.addresses 192.168.1.100/24
```
**Deleting a Connection**:
```bash
nmcli connection delete MyEthernet
```
#### *3. Activating and Deactivating Connections*
**To activate a connection**:
```bash
nmcli connection up MyEthernet
```
**To deactivate a connection**:
```bash
nmcli connection down MyEthernet
```
#### *4. Managing Devices*
**Viewing Device Status**:
```bash
nmcli device status
```
**Enabling/Disabling a Device**:
To disable a device (e.g., Wi-Fi):
```bash
nmcli radio wifi off
```
To enable it back:
```bash
nmcli radio wifi on
```
#### *5. Getting Detailed Information*
To get detailed information about a specific connection or device:
```bash
nmcli connection show MyEthernet
```
or
```bash
nmcli device show eth0
```
Conclusion
Network Manager and NMCLI provide a robust and flexible way to manage network connections in Linux. Whether you prefer a graphical interface or command-line tools, Network Manager simplifies the process of configuring and managing various types of network connections. If you have any questions or need further details on using NMCLI, feel free to ask!