I am learning to use netplan. When writing a YAML configuration file I need to know which renderer to use, either NetworkManager or networkd.
How do I know if I am running NetworkManager or networkd?
I am learning to use netplan. When writing a YAML configuration file I need to know which renderer to use, either NetworkManager or networkd.
How do I know if I am running NetworkManager or networkd?
As near as I can tell, there have been 3 approaches to networks in Linux:
1) The oldest uses the
/etc/network/interfaces
file andifup
/ifdown
scripts to manage these interfaces.2) After that came the
network-manager
daemon (often writtenNetwork-Manager
) which has GUI interfaces available.3) And most recently the
systemd-networkd
daemon (sometimes abbreviated just 'networkd') which is based onsystemd
unit files.To see how your network is being managed, first you must know if you're system is initializing with
systemd
or the olderinit
as it's first process. (Debian and Ubuntu, for example now usesystemd
instead ofinit
).You can check if your system uses
systemd
with this:So if you are NOT running
systemd
, then clearly you can rule outsystemd-networkd
.If you ARE running
systemd
, then check which network service daemons are running with these two commands:You'll see either
Active: active (running)
orActive: inactive (dead)
reported for each one.Note that you can also run these newer commands, but obviously if you don't have systemd, they won't work for you:
But you're not done yet...
Finally, even if one of these two daemons are running, that doesn't mean your network hardware interfaces are being managed by them, as there are exceptions.
First any interfaces defined in
/etc/network/interfaces
are ignored by network-manager. (man 5 NetworkManager
)Next,
systemd-networkd
will only manage network addresses and routes for any link for which it finds a .network file with an appropriate [Match] section. (man 8 systemd-networkd
).By default, Ubuntu desktop version ships with Network Manager. In most desktop environments, it does a good job. In this case, the netplan file should hand over networking to Network Manager. Typically, the relevant file is
/etc/netplan/01-network-manager-all.yaml
It reads:In Ubuntu server edition, since no desktop environment is installed by default; i.e. Gnome, Unity, Wayland, KDE, etc., Network Manager is not possible and therefore not installed. In versions 17.10 and later, networking is handled by netplan alone. The typical relevant file is
/etc/netplan/01-netcfg.yaml
It usually reads:...where enp0s3 is your relevant interface. This will allow an internet connection by DHCP until a full and further configuration can be effected by editing the yaml file and following with: