What is the networking.service?
networking.service
raises or downs the network interfaces configured in /etc/network/interfaces
, that is, those network interfaces which are not managed by NetworkManager. If you look into /lib/systemd/system/networking.service
you will see that all it does is ifup
or ifdown
depending on whether it is to be started or stopped.
It is a oneshot unit, which means that it does its thing and exits, it does not remain running in the background.
By default all network interfaces are managed by NetworkManager and networking.service
does nothing. On a server it is quite common to assign a static IP address to one or more interfaces by editing /etc/network/interfaces
, and in this case those interfaces are no longer managed by NetworkManager and they are raised or downed by network.service
.
Related videos on Youtube
Hoàng Nguyễn
Updated on September 18, 2022Comments
-
Hoàng Nguyễn over 1 year
I'm learning Ubuntu 16.04 LTS and i confuse between
networking.service
,NetworkManager.service
andsystemd-networkd.service
. After googling i found thatNetworkManager.service
andsystemd-networkd.service
are two way to manage the network and we only need 1 of them. No result fornetworking.service
.I already tested on Ubuntu 16.04 Desktop and Server. On desktop
NetworkManager.service
andnetworking.service
are active, on server onlynetworking.service
active. I don't understand whatnetworking.service
is? Could you help me please?-
muru over 7 yearsThe
networking
service just brings up the network devices. Network Manager actually manages them on desktops, and on servers they maybe be managed via/etc/network/interfaces
orsystemd-networkd
.
-
-
Hoàng Nguyễn over 7 yearsThank you! I have one more question. I installed Ubuntu server 16.04 LTS and only networking.service is active, NetworkManager.service and systemd-networkd.service are not. So that mean we don't need them on Ubuntu Server right?
-
AlexP over 7 yearsThe server installer places all network interfaces in
/etc/network/interfaces
, which means that their activation is performed bynetwork.service
. At least all wired interfaces -- I have never used the server variant of Ubuntu on a computer with WiFi. -
steeldriver over 7 yearsIsn't
networking.service
responsible for bringing up the loopback interface (even where all external interfaces are managed by NetworkManager)? -
dtoubelis over 6 years@AlexP NOTE, that OP is asking about
networkd.service
.networking.service
andnetworkd.service
are two different things. Thenetworking.service
does what you describe - executingifup
&ifdown
butnetworkd.service
is actually replacement forifupdown
package designed aroundsystemd
. -
AlexP over 6 years@dtoubelis: Note that this question was asked and answered in 2016.
-
pbies almost 5 yearsIf the
network.service
failed - can I stop it and disable it? When? -
AlexP almost 5 years@pbies: Better find out why it failed. It shouldn't fail.
-
pbies almost 5 years@AlexP
/etc/network/if-up.d/sendmail: 44: .: Can't open /usr/share/sendmail/dynamic run-parts: /etc/network/if-up.d/sendmail exited with return code 2
-
pbies almost 5 years@AlexP I've removed sendmail
sudo apt purge sendmail sendmail-base sendmail-bin
but other error appeared... -
AlexP almost 5 years@pbies: I'm sorry, this is not suitable forum for technical support.