Network Manager
Network Manager on Raspberry Pi
Network Manager is a powerful tool for managing network connections on your Raspberry Pi.
It provides a user-friendly command-line interface called nmcli
that allows you to configure and control network interfaces, connections, and devices.
Key Features of Network Manager
Automatically manages network connections
Supports various connection types: Ethernet, Wi-Fi, mobile broadband, VPN, etc.
Stores network configuration profiles
Provides a command-line interface (
nmcli
) and a graphical interface (nm-applet
)Integrates with systemd for service management
Using Network Manager on Raspberry Pi
Checking Network Manager status: To verify if Network Manager is running, use the following command:
Listing available connections: To list all the connections Network Manager has, use:
Activating a connection: To activate a connection profile named "My Wi-Fi" on interface wlan0, use:
Deactivating a connection: To deactivate a connection on interface eth0, use:
Creating a new Wi-Fi connection: To create a new Wi-Fi connection named "Home Network" with SSID "MyHomeWiFi" and password "secretpassword", use:
Modifying a connection: To modify the IPv4 method of a connection named "Ethernet Connection" to manual and set an IP address, use:
Importing a VPN configuration: To import an OpenVPN configuration file, use:
Best Practices and Use Cases
Server Configuration
For server-like behaviour, where you want to disable automatic connection creation and ignore carrier detection, add the following to the Network Manager configuration file (/etc/NetworkManager/conf.d/server.conf
):
Unmanaging Devices: If you want to manually configure a specific interface (e.g., eth0) and prevent Network Manager from managing it, use:
Scripting and Automation
Network Manager's nmcli
command-line interface is suitable for scripting and automation tasks. You can use it to configure network settings, activate/deactivate connections, and manage devices programmatically.
Desktop and Laptop Use
For desktop and laptop users, Network Manager provides a user-friendly graphical interface called nm-applet
. It allows users to easily manage network connections, view connection status, and perform common network tasks.
VPN Integration
Network Manager supports various VPN technologies, including OpenVPN, PPTP, and Cisco-compatible VPNs. You can easily import VPN configurations and manage VPN connections using nmcli
or the graphical interface.
Last updated
Was this helpful?