• We had to restore from a backup today after a failed software update. Backup was from 0000 EDT and restored it at 0800 EDT so we lost about 8hrs. Today is 07/20/2024. More info here.

Solved Who is managing my interfaces?

Solved issue

banderas20

Active Member
Joined
Aug 1, 2018
Messages
102
Reaction score
42
Credits
799
Hi.

I have a Debian Server VM box and the network cards work perfectly. However, I don't know which service is managing the network interfaces and how to change the way they work.

The box uses NetworkManager and I can see some logs via journalctl. The thing is the file

/etc/NetworkManager/NetworkManager.conf only shows


Code:
[main]
plugins=ifupdown, keyfile

[ifupdown]
managed=false

I can't find any other file or source from where it reads devides and applies DHCP or other configuration. i

Besides, /etc/network/interfaces file only has the lo iface.

Can anybody help me figure out how this is being handled?

Thanks!

PS: Using Debian 12 Bookworm
 


Below is a list of the main files of the network-manager package on a debian box here elicited by the apt-file command, excluding the locale files. I guess somewhere in amongst them would be something helpful to you. The multitude of man pages may provide some guidance.
Code:
[tom@min ~]$ apt-file list network-manager
network-manager: /etc/NetworkManager/NetworkManager.conf
network-manager: /usr/bin/nmtui-connect
network-manager: /usr/bin/nmtui-edit
network-manager: /usr/bin/nmtui-hostname
network-manager: /usr/lib/firewalld/zones/nm-shared.xml
network-manager: /usr/lib/pppd/2.4.9/nm-pppd-plugin.so
network-manager: /usr/lib/systemd/system/NetworkManager-dispatcher.service
network-manager: /usr/lib/systemd/system/NetworkManager-wait-online.service
network-manager: /usr/lib/systemd/system/NetworkManager.service
network-manager: /usr/lib/systemd/system/nm-priv-helper.service
network-manager: /usr/lib/udev/rules.d/84-nm-drivers.rules
network-manager: /usr/lib/udev/rules.d/85-nm-unmanaged.rules
network-manager: /usr/lib/udev/rules.d/90-nm-thunderbolt.rules
network-manager: /usr/lib/x86_64-linux-gnu/NetworkManager/1.44.2/libnm-device-plugin-adsl.so
network-manager: /usr/lib/x86_64-linux-gnu/NetworkManager/1.44.2/libnm-device-plugin-bluetooth.so
network-manager: /usr/lib/x86_64-linux-gnu/NetworkManager/1.44.2/libnm-device-plugin-team.so
network-manager: /usr/lib/x86_64-linux-gnu/NetworkManager/1.44.2/libnm-device-plugin-wifi.so
network-manager: /usr/lib/x86_64-linux-gnu/NetworkManager/1.44.2/libnm-device-plugin-wwan.so
network-manager: /usr/lib/x86_64-linux-gnu/NetworkManager/1.44.2/libnm-ppp-plugin.so
network-manager: /usr/lib/x86_64-linux-gnu/NetworkManager/1.44.2/libnm-settings-plugin-ifupdown.so
network-manager: /usr/lib/x86_64-linux-gnu/NetworkManager/1.44.2/libnm-wwan.so
network-manager: /usr/libexec/nm-daemon-helper
network-manager: /usr/libexec/nm-dhcp-helper
network-manager: /usr/libexec/nm-dispatcher
network-manager: /usr/libexec/nm-initrd-generator
network-manager: /usr/libexec/nm-priv-helper
network-manager: /usr/sbin/NetworkManager
network-manager: /usr/share/bash-completion/completions/nmcli
network-manager: /usr/share/bug/network-manager/control
network-manager: /usr/share/dbus-1/system-services/org.freedesktop.nm_dispatcher.service
network-manager: /usr/share/dbus-1/system-services/org.freedesktop.nm_priv_helper.service
network-manager: /usr/share/dbus-1/system.d/nm-dispatcher.conf
network-manager: /usr/share/dbus-1/system.d/nm-priv-helper.conf
<snip>
network-manager: /usr/share/man/man1/nm-online.1.gz
network-manager: /usr/share/man/man1/nmcli.1.gz
network-manager: /usr/share/man/man1/nmtui-connect.1.gz
network-manager: /usr/share/man/man1/nmtui-edit.1.gz
network-manager: /usr/share/man/man1/nmtui-hostname.1.gz
network-manager: /usr/share/man/man1/nmtui.1.gz
network-manager: /usr/share/man/man5/NetworkManager.conf.5.gz
network-manager: /usr/share/man/man5/nm-settings-dbus.5.gz
network-manager: /usr/share/man/man5/nm-settings-keyfile.5.gz
network-manager: /usr/share/man/man5/nm-settings-nmcli.5.gz
network-manager: /usr/share/man/man5/nm-settings.5.gz
network-manager: /usr/share/man/man5/nm-system-settings.conf.5.gz
network-manager: /usr/share/man/man7/nmcli-examples.7.gz
network-manager: /usr/share/man/man8/NetworkManager-dispatcher.8.gz
network-manager: /usr/share/man/man8/NetworkManager-wait-online.serv
network-manager: /usr/share/man/man8/NetworkManager.8.gz
network-manager: /usr/share/man/man8/nm-initrd-generator.8.gz
network-manager: /usr/share/polkit-1/actions/org.freedesktop.Network
network-manager: /usr/share/polkit-1/rules.d/org.freedesktop.Network
 
Last edited:
Code:
root@ansible:~# grep -i version /etc/os-release
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
As for what networking service Debian uses, it uses the networking.service for bringing up your network interfaces.
Code:
root@ansible:~# journalctl |grep -i networking | tail -n2
Feb 07 08:46:18 ansible systemd[1]: Starting networking.service - Raise network interfaces...
Feb 07 08:46:18 ansible systemd[1]: Finished networking.service - Raise network interfaces.
You can configure your network interfaces in the file "/etc/network/interfaces" or you can create a file with a network configuration in the "/etc/network/interfaces.d" directory, which is include from the first file I mentioned.
 
Code:
root@ansible:~# grep -i version /etc/os-release
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
As for what networking service Debian uses, it uses the networking.service for bringing up your network interfaces.
Code:
root@ansible:~# journalctl |grep -i networking | tail -n2
Feb 07 08:46:18 ansible systemd[1]: Starting networking.service - Raise network interfaces...
Feb 07 08:46:18 ansible systemd[1]: Finished networking.service - Raise network interfaces.
You can configure your network interfaces in the file "/etc/network/interfaces" or you can create a file with a network configuration in the "/etc/network/interfaces.d" directory, which is include from the first file I mentioned.
Hi.

Yes. I also saw these lines mentioning networking.service, but I don't know where the config files are.
Besides, I guess NetworkManager depends on networking.

/etc/network/interfaces.d is empty, which confused me a bit.

I expected to see config files for both services so I could understand the behaviour, but I see it's not very clear....

@osprey , I'll take a look at the wikis you posted.

Thanks everyone!
 
If you're using NetworkManager, then that's what is controlling your interfaces.

Depending n what desktop you're using ( Gnome, Xfce, MATE, KDE ... ) the network settings are in various different places.
But there is a command line tool.

nmcli conn show

That will show all of my connections.

nmcli conn show eno1

That will show all the details about a specific connection. Your interface will likely be named something else besides "eno1"
so you should use the name of the connection from the top command above.

You can add, modify, and delete connections using nmcli.
 
Yes. I also saw these lines mentioning networking.service, but I don't know where the config files are.
Besides, I guess NetworkManager depends on networking.

/etc/network/interfaces.d is empty, which confused me a bit.
The config is in the file /etc/network/interfaces
Code:
root@ansible:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug enp1s0
#iface enp1s0 inet6 dhcp
iface enp1s0 inet static
address 172.30.1.10
netmask 255.255.255.0
gateway 172.30.1.1
dns-nameservers 172.30.1.1
dns-search lan.feedmebits.nl
In that interfaces file the files in the directory /etc/network/interfaces.d are sourced, meaning if you have network interface files with content in there it will include that in your network interface configuration.
 
The config is in the file /etc/network/interfaces
Code:
root@ansible:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug enp1s0
#iface enp1s0 inet6 dhcp
iface enp1s0 inet static
address 172.30.1.10
netmask 255.255.255.0
gateway 172.30.1.1
dns-nameservers 172.30.1.1
dns-search lan.feedmebits.nl
In that interfaces file the files in the directory /etc/network/interfaces.d are sourced, meaning if you have network interface files with content in there it will include that in your network interface configuration.

My /etc/network/interfaces file only shows auto lo. No other interface.
My /etc/network/interfaces.d/ directory is empty.

Hence my confusion :(. Which file/s contain the configuration applied to the current interfaces?

@dos2unix . Yes. I know that. But which default configuration is being read/used to bring up my primary interface and set their parameters?

Thanks everyone!
 
Hence my confusion :(. Which file/s contain the configuration applied to the current interfaces?
Just do a grep of your network interface in the /etc directory, for example like this.
Code:
grep -r enp1s0 /etc
 
Just do a grep of your network interface in the /etc directory, for example like this.
Code:
grep -r enp1s0 /etc

Nothing found.... :(

@osprey, good guide. But I'm trying to figure out which processes set up the initial connection via CLI and the files involved.
 
Nothing found.... :(
Did you copy/paste what I shared or did you actually use your interface name? Which iso did you use to install Debian, can you share a link?
 
Some general observations that occur to me about managing and controlling the network with NetworkManager.

To control the networking on your system you can configure a multitude of configurations in /etc/NetworkManager/conf.d. That's the directory the NetworkManager.conf manual page specifies for that purpose.

That manual page is quite replete with configuration options that can be used to control the networking in a fine-grained manner. If no configurations are set by the user, NetworkManager uses its defaults which can be inquired though the nmcli command.

It's probably wise to seek out some example custom configuration files experienced users have used in /etc/NetworkManager/conf.d to get a hang of the matter. I'm not one of those experienced users, rather a default user in the past.

In the listing of NetworkManager's files in post #2 there are a number of manual pages each of which describes how different options can be set for the various networking elements that they have some effect upon. Generally they are set by using nmcli rather than by configuration file. There's examples in the man page: "nmcli-examples".

If it's of interest to see the order in which networking services are started up you could run:
Code:
systemd-analyze blame
and pick out all the networking services amongst the other services that are being started up. The order of their running can be determined by the time stamps.
 
Did you copy/paste what I shared or did you actually use your interface name? Which iso did you use to install Debian, can you share a link?

I used my interface name. The only useful thing is:

/proc/kmsg: enp0s3. Link becomes ready

I used debian-12.4.0-amd64-netinst.iso from https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.4.0-amd64-netinst.iso

@osprey

Running systemd-analyze blame shows networking.service boots up prior to NetworkManager-wait-online.service

In fact, journalctl -u networking shows

systemd[1] - .... Raise Network Interfaces

But no more info.

Maybe it's a configuration made in the initial Debian Installation, but I'd like to know where this config is...

Thanks!
 
<snip>
Running systemd-analyze blame shows networking.service boots up prior to NetworkManager-wait-online.service

But no more info.
<snip>
Maybe it's a configuration made in the initial Debian Installation, but I'd like to know where this config is...

Thanks!
@banderas20
The output of the command: systemd-analyze blame on this machine here shows a number of steps involved in producing a working network, which is shown below.

This machine runs connman rather than NetworkManager. I don't have a machine here at the moment with NetworkManager to make it more equivalent to yours, but connman is also a networking service manager, though more spare than NetworkManager.

The following are the main steps identifiable from the output of: systemd-analyze blame, which the operating system takes to bring up networking. The time stamps indicate the sequence of events. Within the pointy brackets. < ... >, are some explanatory notes I have added.

10ms ifupdown-pre.service < Helper to synchronize boot for ifupdown >
44ms wpa_supplicant.service < wireless authentication service>
47ms systemd-modules-load.service < loading kernel module for ethernet >
54ms systemd-rfkill.service < loads rfkill switch (wireless control) >
59ms [email protected] < loads kernel modules including networking interface drivers >
60ms modprobe@nvme_fabrics.service < loads "Non-volatile Memory Express™ (NVMe) over TCP NVMe/TCP) setup >
68ms connman.service < networking service start >
72ms systemd-udevd.service < udev providing low-level access to devices, including network devices >

Relevant udev rules that are part of the udevd.service providing network access:
71-seat.rules <:# 'Plugable' USB hub, sound, network, graphics adapter >
81-net-dhcp.rules < :# Network interfaces requiring DHCPOFFER messages to be broadcast >
81-net-dhcp.rules <:# checked by the networkd DHCP4 client to set the DHCP option >
99-systemd.rules <:# We need a hardware independent way to identify network devices. >

136ms dbus.service < run the system message bus so processes, including networking, can communicate with each other >
316ms networking.service < raise the networking interfaces finally after all the preceding processing of network items >
397ms dev-nvme0n1p3.device < bring up the hard drive partition enabling access >
5.847s connman-wait-online.service < wait for network to be configured by connman >

It is clear that there is some complexity to the bringing up of networking on the machine. The networking services such as NetworkManager with it's nmcli command, and in the above case, connman with its analogous connmanctl command, are the most efficient means of configuring the respective networks. As for where the "initial configurations" are found, they are found in the default settings of the numerous programs involved in the above processes. Those settings are not usually directly accessed, but as mentioned, the configuration utilities of the networking service managers (i.e. nmcli etc.) are used to show, control and alter settings.
 
Last edited:
I just used that same iso to install another test vm, however this time I installed Gnome along with it. Seems like now I am getting NetworkManager as what controls the network interfaces and with my other Debian vm which doesn't have a DE installed it uses the networking.service to manage the network interfaces. It makes me think that depending on what you choose during the installation can effect what will be installed to control your network interfaces. So what DE did you select during the installation or what exact options did you select in the different parts of the installation?
 
Hi. I'm running GNOME.

I think I figured out what's happening.

First, the kernel detects the network card.
Then, the NetworkManager takes control over the NIC and assigns DHCP by default. That is why it works.

When I tried to add a secondary nic, then none of both work until I modify the config. So I guess only if I add some manual extra configuration they will work.

It was the default configuration what confused me.

I will compare the NetworkManager.conf with one and two nics and post the reslults.
 
Hi.

With 2 NICs, NetworkManager is making a mess and only one of them works. If I bring one nic up, the other one goes down.
I will try to set the properties with a tool like Netplan and NetworkManager as a renderer.
 
Hi. With Netplan it works like a charm. However, the config file of NetworkManager doesn't give as much info.

If I can manage everything with Netplan + NetworkManager, it's perfect.

Thanks to this thread, I learnt many things about networking.

Thanks everyone!
 
Netplan would be added complexity to me, and not as powerful and NetworkManager.

the config files in NetworkManager don't show everything.

nmcli con show ( connection ) will display everything about that connection.
Much more than netplan does.
 

Staff online

Members online


Latest posts

Top