Skip to main content
minor clarification
Source Link
Seamus
  • 3.9k
  • 2
  • 21
  • 48

I discovered this question while searching for something else, but had just developed a solution for my own use in Debian. I think it answers the OP's question:

How to identify the way that a Debian (or another Linux distro) system use to configure its network stack?

This is a rather simple-minded answer I think. It assumes that the software being used to manage the network runs as a service under systemd, and so amounts to listing all systemd units, and applying grep filters:

$ string1=$(systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service' | grep -E 'running')  
$ string2=$(systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service' | grep -Ev 'dead')  
$ if [ -n "$string1" ]; then echo ${string1::24}; else echo ${string2::20}; fi 

As it turns out - for the versions of Debian 'bookworm' that I use at least, there are only 3 network services to choose from. (Netplan isn't installed, but could probably be accommodated under this scheme.) :

Note that Netplan isn't installed in my default installation, but could probably be accommodated under this scheme.

  • NetworkManager.service
  • systemd-networkd.service
  • networking.service

If you list those services, you see the following as the default setup (using NetworkManager) :

$ systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service'  

  networking.service                     loaded    active   exited    Raise network interfaces
  NetworkManager.service                 loaded    active   running   Network Manager
  systemd-networkd.service               loaded    inactive dead      Network Configuration

However, if you disable & mask NetworkManager in favor of ifupdown/networking.service, you will see the following. Note that the networking.service status does not change. :

$ systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service' 

  networking.service                     loaded    active   exited    Raise network interfaces
  NetworkManager.service                 masked    inactive dead      NetworkManager.service
  systemd-networkd.service               loaded    inactive dead      Network Configuration

I discovered this question while searching for something else, but had just developed a solution for my own use in Debian. I think it answers the OP's question:

How to identify the way that a Debian (or another Linux distro) system use to configure its network stack?

This is a rather simple-minded answer I think. It assumes that the software being used to manage the network runs as a service under systemd, and so amounts to listing all systemd units, and applying grep filters:

$ string1=$(systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service' | grep -E 'running')  
$ string2=$(systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service' | grep -Ev 'dead')  
$ if [ -n "$string1" ]; then echo ${string1::24}; else echo ${string2::20}; fi 

As it turns out - for the versions of Debian 'bookworm' that I use at least, there are only 3 network services to choose from. (Netplan isn't installed, but could probably be accommodated under this scheme.) :

  • NetworkManager.service
  • systemd-networkd.service
  • networking.service

If you list those services, you see the following as the default setup (using NetworkManager) :

$ systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service'  

  networking.service                     loaded    active   exited    Raise network interfaces
  NetworkManager.service                 loaded    active   running   Network Manager
  systemd-networkd.service               loaded    inactive dead      Network Configuration

However, if you disable & mask NetworkManager in favor of ifupdown/networking.service, you will see the following:

$ systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service'
  networking.service                     loaded    active   exited    Raise network interfaces
  NetworkManager.service                 masked    inactive dead      NetworkManager.service
  systemd-networkd.service               loaded    inactive dead      Network Configuration

I discovered this question while searching for something else, but had just developed a solution for my own use in Debian. I think it answers the OP's question:

How to identify the way that a Debian (or another Linux distro) system use to configure its network stack?

This is a rather simple-minded answer I think. It assumes that the software being used to manage the network runs as a service under systemd, and so amounts to listing all systemd units, and applying grep filters:

$ string1=$(systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service' | grep -E 'running')  
$ string2=$(systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service' | grep -Ev 'dead')  
$ if [ -n "$string1" ]; then echo ${string1::24}; else echo ${string2::20}; fi 

As it turns out - for the versions of Debian 'bookworm' that I use at least, there are only 3 network services to choose from :

Note that Netplan isn't installed in my default installation, but could probably be accommodated under this scheme.

  • NetworkManager.service
  • systemd-networkd.service
  • networking.service

If you list those services, you see the following as the default setup (using NetworkManager) :

$ systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service'  

  networking.service                     loaded    active   exited    Raise network interfaces
  NetworkManager.service                 loaded    active   running   Network Manager
  systemd-networkd.service               loaded    inactive dead      Network Configuration

However, if you disable & mask NetworkManager in favor of ifupdown/networking.service, you will see the following. Note that the networking.service status does not change. :

$ systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service' 

  networking.service                     loaded    active   exited    Raise network interfaces
  NetworkManager.service                 masked    inactive dead      NetworkManager.service
  systemd-networkd.service               loaded    inactive dead      Network Configuration
clarifications
Source Link
Seamus
  • 3.9k
  • 2
  • 21
  • 48

I discovered this question while searching for something else, but had just developed a solution for my own use in Debian. I think it answers the OP's question:

How to identify the way that a Debian (or another Linux distro) system use to configure its network stack?

This is a rather simple-minded answer I think. It assumes that the software being used to manage the network runs as a service under systemd, and so amounts to listing all systemd units, and applying a grep filterfilters:

$ string1=$(systemctl list-units --all | grep -E -iEi "network'networking\.*\|NetworkManager\.service|networkd\.*running"' | grep 'service' | grep -E 'running')  
$ string2=$(systemctl NetworkManager.servicelist-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service' | grep -Ev 'dead') loaded 
$ if [ active-n "$string1" ]; runningthen echo ${string1::24}; Networkelse Managerecho ${string2::20}; fi 

As it turns out - for the versions of Debian 'bookworm' that I use at least -, there are only 4 network services to choose fromonly 3 network services to choose from. (as recognized by the OP in his Question)Netplan isn't installed, but could probably be accommodated under this scheme. So) :

  • NetworkManager.service
  • systemd-networkd.service
  • networking.service

If you list those services, you see the answer kind offollowing as the falls outdefault setup (using NetworkManager) :

$ systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service'  

  networking.service                     loaded    active   exited    Raise network interfaces
  NetworkManager.service                 loaded    active   running   Network Manager
  systemd-networkd.service               loaded    inactive dead      Network Configuration

However, if you disable & mask NetworkManager in favor of that.ifupdown/networking.service, you will see the following:

$ systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service'
  networking.service                     loaded    active   exited    Raise network interfaces
  NetworkManager.service                 masked    inactive dead      NetworkManager.service
  systemd-networkd.service               loaded    inactive dead      Network Configuration

I discovered this question while searching for something else, but had just developed a solution for my own use in Debian. I think it answers the OP's question:

How to identify the way that a Debian (or another Linux distro) system use to configure its network stack?

This is a rather simple-minded answer I think. It assumes that the software being used to manage the network runs as a service under systemd, and so amounts to listing all systemd units, and applying a grep filter:

$ systemctl list-units --all | grep -E -i "network.*\.service.*running"
  NetworkManager.service     ...       loaded    active   running   Network Manager

As it turns out - for Debian 'bookworm' at least - there are only 4 network services to choose from (as recognized by the OP in his Question). So the answer kind of falls out of that.

I discovered this question while searching for something else, but had just developed a solution for my own use in Debian. I think it answers the OP's question:

How to identify the way that a Debian (or another Linux distro) system use to configure its network stack?

This is a rather simple-minded answer I think. It assumes that the software being used to manage the network runs as a service under systemd, and so amounts to listing all systemd units, and applying grep filters:

$ string1=$(systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service' | grep -E 'running')  
$ string2=$(systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service' | grep -Ev 'dead')  
$ if [ -n "$string1" ]; then echo ${string1::24}; else echo ${string2::20}; fi 

As it turns out - for the versions of Debian 'bookworm' that I use at least, there are only 3 network services to choose from. (Netplan isn't installed, but could probably be accommodated under this scheme.) :

  • NetworkManager.service
  • systemd-networkd.service
  • networking.service

If you list those services, you see the following as the default setup (using NetworkManager) :

$ systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service'  

  networking.service                     loaded    active   exited    Raise network interfaces
  NetworkManager.service                 loaded    active   running   Network Manager
  systemd-networkd.service               loaded    inactive dead      Network Configuration

However, if you disable & mask NetworkManager in favor of ifupdown/networking.service, you will see the following:

$ systemctl list-units --all | grep -Ei 'networking\.|NetworkManager\.|networkd\.' | grep 'service'
  networking.service                     loaded    active   exited    Raise network interfaces
  NetworkManager.service                 masked    inactive dead      NetworkManager.service
  systemd-networkd.service               loaded    inactive dead      Network Configuration
Post Undeleted by Seamus
Post Deleted by Seamus
Source Link
Seamus
  • 3.9k
  • 2
  • 21
  • 48

I discovered this question while searching for something else, but had just developed a solution for my own use in Debian. I think it answers the OP's question:

How to identify the way that a Debian (or another Linux distro) system use to configure its network stack?

This is a rather simple-minded answer I think. It assumes that the software being used to manage the network runs as a service under systemd, and so amounts to listing all systemd units, and applying a grep filter:

$ systemctl list-units --all | grep -E -i "network.*\.service.*running"
  NetworkManager.service     ...       loaded    active   running   Network Manager

As it turns out - for Debian 'bookworm' at least - there are only 4 network services to choose from (as recognized by the OP in his Question). So the answer kind of falls out of that.