Ubuntu

How to Restart the Network in Ubuntu 22.04

Restarting or rebooting the system is the primary solution whenever a problem occurs. Similar to this, restarting the network is a quick fix for any problem that occurs in the network. There are a variety of situations where you might need to restart or reboot the network in Ubuntu, such as when the network settings are changed or an active network connection isn’t functioning properly. All Linux systems need their network services to be restarted if any problem occurs with the networks. This tutorial covers the several methods to restart your network in Ubuntu 22.04. We can pick the one that best meets our requirements. There are two categories of methods:

How to Restart the Network in Ubuntu 22.04

It’s surprising how frequently restarting the network can fix the network-related issues. Some connection issues are serious and they require some tricks and approaches. So, don’t be discouraged; simply rebooting the network can be proved helpful in resolving any connectivity problems. The purpose of this post can be achieved in several ways, thanks to Linux’s versatility. All the methods are simple, but it depends on how the system is used and whether you have the proper tools.

Method #1: Using the Command Line to Restart the Network in Ubuntu

If you are running the Ubuntu’s server edition, the terminal is already opened. In the Ubuntu desktop edition, using the Ctrl+Alt+T keyboard shortcut gives you an access to the terminal. Several commands can now be used to restart your network in Ubuntu. The majority of the commands that we will use here should work to restart the network in the Linux distributions and Debian.

Reboot the Network Using the Network Manager Service

Using the command line is the simplest approach to restart your network. Rebooting the Network-Manager service is similar to executing it with the graphical method.

If it runs successfully, the network icon may disappear and then reappear for a while. In Ubuntu 22.04, using the previous command may return the following error:

To avoid this error, there is an alternative command using the “systemctl” to perform the same task.

Restart the Network Using the Systemctl Command

For this method, the “service” command is simply a wrapper also for “Upstart commands” and “init.d scripts”. Compared to service, the “systemctl” command is far more versatile. This is usually what we prefer.

Running the previous command might pop-up an “Authentication required” window where we enter the password to restart the Network-Manager service.

After entering the password, the network is rebooted. The network icon should momentarily disappear (again). You can see the manual page for the systemctl to see what other options are available.

Restart the Network Using the Nmcli Command

This is another tool that can be used to manage the networks in an Ubuntu system. It is popular among sysadmins since it is simple to use. This method includes two steps: the network must first be turned off and then it must be turned back on.

The network icon disappears and the network will terminate. Use the following command to restart it:

For further options, you can check the nmcli manual page.

Restart the Network Using the Ifup & Ifdown Command

This command changes the state of a network interface so that it can send and receive the data either successfully or unsuccessfully. Every Linux user should be familiar with this command of networking. Use ifdown to disable all the network interfaces. And use the ifup to enable them all again.

Combining these two commands would be a good practice:

Even if the network symbol in your system tray won’t disappear with this method, you won’t be able to connect to anything.

Restart the Network Using the Nmtui Command

System administrators frequently use this alternative method.  A text menu is launched that you can access from your terminal to manage the networks.

The previous command should display the following menu:

The up arrow key and down arrow key in nmtui can be used to move on different options. To select the options, the “enter” button can be used.

Select “Activate a connection” option:

From the options, select the network that is marked with a star (*). It is MGEO72, in our case. Hit the Enter key. This should terminate the connection.

Now, select the network connection that we want to activate:

Hit the Enter key. The selected connection should reactivate as a result.

Tab the key twice to select back:

Press the enter key. You ought to return to the main menu of the nmtui after doing this.

Select “Quit” from the options:

This should close the application and return you to the terminal. All done! Your network is successfully rebooted.

Method #2: Restarting the Network Using the Ubuntu GUI

Of course, for Ubuntu desktop users, this is the simplest method to restart the network. The perilously discussed command line methods can be used if this one doesn’t work.

First, look at your top panel. The system tray should contain a network icon (in our case, a wired connection icon, as that is what we use). From the screen’s upper right corner, click or tap on the network icon. The “Wired Connected” option is displayed in a pop-up menu:

When you select this option, a “Turn Off” option also shows up. It can be pressed to disconnect the network connection:

To restart the network, select the “Connect” option:

It restarts the network again.

Conclusion

In this tutorial, we learned that whenever a problem occurs in the networks, it can be resolved by restarting the network. We divided this tutorial into two sections. In the first section, we explained how you can restart the network in Ubuntu 22.04 using the command line. In the command line method, we used the multiple commands like systemctl, nmcli, NetworkManager restart, ifup & ifdown, and nmtui. In the second section of this post, we explained how the network can be rebooted using the GUI method in Ubuntu 22.04.

 

Similar Posts