Debian / Ubuntu Linux restart network interface

Share

In this article, we will see How to restart Network Interface in Debian and Ubuntu. We can restart the networking service in Linux using various command. Use the following commands as per your Linux distribution to restart the networking service. You must run the command as root user either using sudo or su commands. The ifup command bring a network interface up. The ifdown command take a network interface down.

Use the following command to find out if you are using systemd networkd service, or networking or NetworkManager as service name with the systemd:

systemctl list-unit-files --type=service --state=enabled
systemctl list-unit-files --type=service --state=enabled | grep network

Here is what I see on Debian Linux version 12 (systemd-networkd.service is the active service name):

systemd-network-generator.service enabled enabled
systemd-networkd-wait-online.service enabled disabled
systemd-networkd.service enabled enabled

Hence, the command to restart depends upon your version of Debian Linux. The latest version of Debian or Ubuntu Linux distro with systemd networkd service can use the following command:

sudo systemctl restart systemd-networkd.service
sudo systemctl status systemd-networkd.service

Debian/Ubuntu Linux with networking services, run:

sudo systemctl restart networking
sudo systemctl status networking

The latest version of Ubuntu or Debian service name changed to NetworkManager. Hence, use the systemctl command as follows:

sudo systemctl restart NetworkManager
sudo systemctl status NetworkManager

On older (pre systemd) restart network interface, enter:

sudo /etc/init.d/networking restart

Read more

How To