How to Restart the Networking Service in Linux?

Are you looking for a way to restart the network manager or to restart the networking service in a Linux-based machine? Well, this guide has been crafted for you. 

There are multiple scenarios in which you must restart your network services in the Linux Operating System. If you are not familiar with the Linux Operating System, then this is a very complicated and daunting task. However, managing and troubleshooting the network is one of the key responsibilities of a Linux System Administrator.

The methods of restarting the network services in Linux can depend on the variant of Linux that is being used, especially the GUI methods. However, the generic commands are the same.

Method 1: Use the “nmtui” Command in Linux

The command line tool that is part of the network management package is the “nmtui,” which stands for “Network Manager Text User Interface.” This nmtui tool is one of the most liked tools by network admins. 

Open up a terminal session and access the nmtui tool by executing the following command:

sudo nmtui

Once you have inserted the password for the sudo user, you will see the following output:

You will have to use the arrow keys to navigate through the menu. Select the second option, “Activate a connection,” and press the “Enter” key. A list of all the available networks will be displayed with the nmtui tool:

Select your network and then use the arrow keys to select the option “Deactivate” and press the “Enter” key. Once that is done, you need to reactivate it by going inside the same “Activate a Connection” tab and selecting the same network. However, this time, the button would change to “Activate”:

With that done, the network has been successfully restarted. Lastly, you can quit the nmtui tool.

Method 2: Use the Basic Network Restart Commands

Apart from the nmtui tool, you can also use the basic network management commands for Debian-based. To do this, open up a new terminal session on your Debian-based machine and then type the following command:

sudo /etc/init.d/networking restart

This will automatically restart the network services. However, you can also use the commands mentioned below to stop and start the network manually

sudo /etc/init.d/networking stop
sudo /etc/init.d/networking start

However, you will require the sudo access rights to execute these commands.

Dracula Servers Dedicated Servers

When it comes to hosting Linux applications that demand superior performance and dedicated resources, Dracula Servers’ Dedicated Servers stand out as a reliable choice. Offering a range of powerful configurations, these dedicated servers are optimized for Linux environments, providing the ideal infrastructure for applications, websites, and services that require robust computing power. With Dracula Servers, you get full control over your server, allowing you to tailor it to your Linux-based requirements.

The dedicated support team ensures smooth operations and quick issue resolution, making Dracula Servers a trusted partner for those seeking top-notch Linux hosting solutions.

Explore the possibilities with Dracula Servers Dedicated Servers.

Method 3: Use the systemctl Commands to Restart the Network

Like the previous method, you can use the “systemctl” commands to restart the network services on your Linux machine.  To do this, open up a new terminal session and then type the following commands:

sudo systemctl restart networking

One more additional feature that you get with the systemctl tools is that you can check the status of the network services by running the following command:

sudo systemctl status networking

Method 4: Use the nmcli Tool to Restart Network Service

The nmcli tool is like your trusty sidekick in the NetworkManager package. System administrators love it for its user-friendly approach to restarting networks on Linux. If you’re navigating the network scene on various Linux flavors, here’s the secret handshake:

Open a new terminal session and execute the following command inside it:

sudo nmcli networking off

Executing this spell takes down the network. Now, to bring it back to life and conjure up the network icon, execute the following command

sudo nmcli networking on

With the nmcli command, you can also check the status of the network by executing the following:

nmcli -o

Method 5: Use the ifup and ifdown to Restart Network

The commands ifup and ifdown are like the maestros directing a symphony of network interfaces in Linux. They hold a special place in the networking command hall of fame, as they turn off (ifdown) and on (ifup) all network interfaces.

Start by installing these tools you can use the following command:

sudo apt update && sudo apt install ifupdown -y

After that, you can use the following commands to turn off and turn on the Network Services:

sudo ifdown -a
sudo ifup -a

You can also combine these two commands and execute them as one:

sudo ifdown -a && sudo ifup -a

Method 6: Use the GUI Settings Based on Linux

Many modern Linux distributions come with a graphical user interface that can be used to change different settings. Restarting the network can also be done by the GUI setting options. However, the exact option and the settings application may vary from distribution to distribution.

To do this, open up the settings application from the application tray:

After that, head over to the “Network” tab from within the settings application. In Debian-based (Ubuntu) linux distributions, the tab is located on the left side:

Within the Network, you will see the connected network and the slider to turn it off/on:

Use the slider to turn off the connected network and wait for a few seconds. After that, use the same slider to turn on the network services. Doing these steps will ensure that the network services have been restarted on your linux machine.

That completes this guide!

Wrap Up

Multiple issues and reasons can require the Linux System Admin to restart the network services in a Linux System. These can vary from different network bugs, slow response time, a lot of packet loss, or the constant disconnection of the network. The process of restarting the network services is not difficult, but it can be very daunting to a new user.

To do this, you can utilize the text-based interface of the “nmtui” as it is very easy to use. Other than that, you can use the CLI commands to manually restart the running services of “Networking”, which can also be done with the use of the systemctl commands.

Apart from all of this, you can use the GUI that is present in almost all newer distributions of Linux. Head inside the settings and then inside the network’s tab, turn off the network, and turn it back on.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments