Translation(s): English – Français – Italiano – German – Português (Brasil) – 简体中文 – Русский
Contents
NetworkManager attempts to keep an active network connection available at all times. |
In parallel with NetworkManager some network interfaces may be under control of
ifupdown (/etc/network/interfaces)
For details see NetworkConfiguration.
NetworkManager is composed of two layers:
A daemon running as root: NetworkManager(8) is usually managed by systemd as NetworkManager.service.
Front-ends: nmcli(1) command line tool, nmtui(1) text terminal interface, applets for desktop environments.
The daemon, nmtui and nmcli tools are shipped in the network-manager package. GUI tools are packaged separately: nm-tray, network-manager-gnome (nm-applet), plasma-nm, etc. Additionally, there are various plugins available that enable NetworkManager to handle other, special connections like different types of VPN connections.
NetworkManager will only handle interfaces not declared in /etc/network/interfaces (see README file).
NetworkManager keeps connection information on known individual networks in configuration files called profiles. Those are stored at /etc/NetworkManager/system-connections/. For options in these files refer to the manpage on nm-settings: man nm-settings or online. They can be edited (as root) using a text editor or the nm-connection-editor (enclosed in network-manager-gnome).
For changes in configuration to become effective, you may have to restart the NetworkManager daemon:
sudo service network-manager restart
Starting with Debian 11 (bullseye), use:
sudo service NetworkManager restart
Features
The features of NetworkManager are described on its homepage.
Documentation
Make sure you read the fine manual:
/usr/share/doc/network-manager/README.md.gz (online) and /usr/share/doc/network-manager/README.Debian (online)
nm-settings-nmcli(5) for configuration options
other man pages from the network-manager package
interfaces(5) man page
Wired Networks are Unmanaged
As of Debian 6.0 "Squeeze", NetworkManager does not manage any interface defined in /etc/network/interfaces by default.
Unmanaged devices means NetworkManager doesn't handle those network devices. This occurs when two conditions are met:
The file /etc/network/interfaces contains anything about the interface, even:
allow-hotplug eth0 iface eth0 inet dhcp
And /etc/NetworkManager/NetworkManager.conf contains:
[main] plugins=ifupdown,keyfile [ifupdown] managed=false
Enabling Interface Management
If you want NetworkManager to handle interfaces that are enabled in /etc/network/interfaces:
Set managed=true in /etc/NetworkManager/NetworkManager.conf.
Restart NetworkManager:
sudo service network-manager restart
Starting with Debian 11 (bullseye), use:
sudo service NetworkManager restart
"Auto Ethernet" and "Auto eth0"
Auto Ethernet means "Select an Ethernet interface automatically"
Auto eth0 means "autoconfigure the eth0 interface".
FAQ
- Q. How do I configure a static IP address (for a server, etc) ?
A) Use nm-connection-editor or configure /etc/network/interfaces as described in NetworkConfiguration.
- Q. How can I configure DNS for NetworkManager?
A) The short answer is to use nm-connection-editor. For the long answer see the corresponding entry in NetworkConfiguration.
- Q. Why can't I see NetworkManager with my new user account ?
A) Make sure human users are in the netdev group (see /usr/share/doc/network-manager-gnome/README.Debian).
- Q. How to set up a connection sharing ("hotspot") for a wired interface ?
A) First make sure to install dnsmasq-base (but not dnsmasq unless you disable the system daemon in /etc/default/dnsmasq). Then use nm-connection-editor and setup a new profile using "shared to other computer" as the method for IPv4 (not possible from Gnome3's gnome-control-center). This hides all the complexity (dnsmasq, iptables, sysctl). Finally, use that profile for the network interface connected to the shared network. For Wi-Fi interfaces, a hotspot functionality is provided which uses the same functionality besides setting up an ad-hoc WiFi network.
- Q. How can I set up OpenVPN using NetworkManager?
A) Using the network-manager-openvpn-gnome package, it is possible to configure all aspects of OpenVPN, including importing configs from the service provider and automatically starting for specific connections (via nm-connection-editor).
See Also
External Links
https://networkmanager.dev/ - Project homepage
https://wiki.gnome.org/Projects/NetworkManager – Project page in GNOME wiki (with some documentation)
https://www.redhat.com/sysadmin/becoming-friends-networkmanager Becoming friends with NetworkManager: mncli tutorial.
nmtui(1) – Interactive text client
nmcli(1) – Command-line client

