How to Restart Networking Service on Linux


Are you facing connectivity issues after some configurations in the Network? That’s normal, you need to manage the network manager.

When dealing with any networking component on Linux, the network services do not function properly which raises connectivity issues on the system. To rectify this, it is recommended to restart the networking services of the system. For that, the Network Manager is the key component that serves the purpose or the specific network interface can also be manipulated to serve the purpose.

Considering its importance, this post offers possible methods to restart the networking service on various flavors of Linux.

Note: The commands in this post are expected as a root user which is recommended while doing any manipulation with the system. If you are not root, then use the sudo keyword to have the privileges.

Approach #1: How to Restart a Networking Service on Linux Using Commands?

Linux offers the “systemctl” and the “service” commands to restart the networking services. Apart from that, the “ifup”, “ifdown”, and “ip link” commands can also be used to restart the specific network interface. Let’s practice all these:

Using the systemctl Command

The restart option of the systemctl command is used to restart any service. The service name may differ for networking services on various Linux distributions. However, in the recent updates of a few Linux distributions, the networking service name has been replaced with the NetworkManager.

To restart networking services, the following command is used:

# systemctl restart NetworkManager

Note: You may not be able to get the commands executed on the Arch Linux (if using old releases of Arch). For that, you can use the command:

# systemctl restart systemd-networkd.service

Using the service Command

Like the systemctl command, the service command also restarts the networking manager through its name, i.e., either network as written below:

# service NetworkManager restart

Using the ip link Command

The ip link command also refers to stopping/starting the access through the network interface(s) which ultimately restarts the networking services of the system. Before manipulating the interface, use the “ip a” command to get the id of the network interface.

Now, let’s have a look at the supported commands to turn off/on the network interface.

Turn Off the Interface:

# ip link set  down

Turn On the Interface:

# ip link set  up

Using the nmcli Command

The nmcli command is a command line support to manage the network. The nmcli does not support the direct restart option, but it offers to stop and then start the networking services.

To stop the Network Manager:

$ nmcli networking off

To start the Network Manager again:

$ nmcli networking on

Using the NetworkManager-TUI (Alternative of the nmcli Command)

Most of the Linux distributions support the NMTUI tool to manage the network on the terminal’s interface. It is pre-installed on various distributions. To use it, just run the keyword nmtui in the terminal and hit enter:

# nmtui

Choose the option “Activate a connection” using the arrow keys and hit enter.

Now, choose the option “Deactivate” using the tab key and hit enter which will deactivate the connection.

Now, choose the “Activate” to enable the networking services again.

Note: To exit out of the interface, use the tab key to choose “Back” and then “Quit”.

Approach #2: How to Restart a Networking Service on Linux Using GUI?

Linux has evolved its GUI alongside its strong CLI support. Now, various Distributions of Debian, RHEL/Fedora, and Arch are equipped with the GUI. The process of restarting the networking service is more or less the same in all the Linux distributions. Let’s see how the networking service can be restarted through GUI:

Go to the system’s settings and then navigate to the Networks settings. Here, a network connection will be displayed to whom your system is connected. Just toggle Off the button and then turn it On to refresh the networking service:

Network Settings on Ubuntu:

Network Settings on CentOS:

Network Settings on Fedora:

Wrap-Up

The networking services need to be restarted when any network-related configurations are required to apply for the correct functioning of the network. There are various commands including systemctl, service,ip link, nmcli, and nmtui. However, the GUI method can also be used to restart the networking services. This post has covered all these commands and the GUI method to restart the networking manager in various flavors of Linux.

Print Friendly, PDF & Email
Categories