nmcli
nmcli
is a command-line interface for managing NetworkManager, a tool used to manage network connections on Linux-based systems. It provides a convenient way to configure network interfaces, Wi-Fi connections, VPNs, and other networking configurations directly from the command line.
Key Features and Subcommands
Here’s a breakdown of some common nmcli
commands and their usage:
1. nmcli general
Used to display general system network settings and manage NetworkManager.
Show general status of NetworkManager:
This command shows the overall status of NetworkManager (e.g., whether it's running).
Show the NetworkManager version:
Enable/Disable NetworkManager:
2. nmcli device
Manages network devices and shows their status.
Show all network devices:
Displays the status of all network devices (e.g., Ethernet, Wi-Fi, etc.).
Bring a device up or down:
Show detailed information about a device:
Change device connection:
3. nmcli connection
Used to manage network connections (Ethernet, Wi-Fi, VPN, etc.).
Show all connections:
Show a specific connection:
Activate a connection:
Deactivate a connection:
Add a new Wi-Fi connection:
Delete a connection:
Edit a connection:
4. nmcli networking
Used to control the overall networking status.
Enable or disable networking:
5. nmcli radio
Used to control the wireless radio (Wi-Fi) state.
Enable Wi-Fi radio:
Disable Wi-Fi radio:
Enable/Disable Bluetooth radio:
6. nmcli vpn
Manages VPN connections.
Show VPN connections:
Add a VPN connection:
Activate a VPN connection:
7. nmcli monitor
Monitors network status in real-time.
Monitor changes to connections:
This command will keep the terminal open and monitor any network changes in real-time.
8. nmcli wifi
Manages Wi-Fi connections and networks.
List available Wi-Fi networks:
Connect to a Wi-Fi network:
Disconnect from the current Wi-Fi network:
Examples of nmcli Usage
Check the current connection status:
Change the IP address of an interface:
Create a new Ethernet connection:
Enable and disable Wi-Fi:
Activate or deactivate a connection:
Conclusion
nmcli
is a powerful and flexible tool for managing network connections on Linux systems. Whether you're configuring an Ethernet connection, connecting to Wi-Fi, managing VPNs, or even controlling network device states, nmcli
provides a comprehensive set of commands to handle all your network configuration needs from the command line.
Last updated