Raspberry Pi

How to Restart the Network on Raspberry Pi

Connecting Raspberry Pi to a network is beneficial since it allows users to perform Internet related tasks with ease such as creating a web server, remotely accessing Raspberry Pi device and so on. However, sometimes, the users may experience problems while connecting the device to a network and they prefer restarting the device to fix the problem. However, those users working on important tasks are not allowed to take a risk of restarting the system to fix the network issue. In that case, they can simply restart the network to fix the problem.

This article is a detailed guide to show you different methods to restart the network on Raspberry Pi.

How to Restart the Network on Raspberry Pi?

There are two ways to restart the network on Raspberry Pi and both methods are discussed below:

Method 1: Restart the Network by Using Network Manager

Network Manager is a tool used for performing network related tasks on the system. You can install this tool directly from source Raspberry Pi repository using the following command:

$ sudo apt install network-manager

Once the Network Manager is installed, open the raspi-configuration tool using the below-mentioned command:

$ sudo raspi-config

Then go to Advanced Options from the configuration tool:

Then further go to the Network Config option:

Select the NetworkManager option from the Network Configuration:

Then select Ok to complete the selection:

After which network manager will be activated

Then use the below-mentioned command to check the network service status using the Network Manager:

$ systemctl status NetworkManager.service

The output will display the status of the network whether it is active or not.

To restart the network service through Network Manager, use the following command:

$ sudo systemctl restart NetworkManager.service

A network will quickly restart as soon as you run the above command:

Method 2: Restart the Network Using nmcli Command

Nmcli command is another useful command-line tool that controls the Network Manager on the system. You can also use this command to restart the network on the Raspberry Pi system in case there is any problem from the network side.

The command also shows you the connection status of the available networks within your device range once you run the following command in the terminal:

$ sudo nmcli device stats

The output of the above command will display the network status of all the available networks on Raspberry Pi.

Although my network is already connected, but if there is any other issue related to your network, you can turned it off using the following command:

sudo nmcli networking off

Then turned it on again using the following command to fix the problem.

$ sudo nmcli networking on

Conclusion

Restarting the network on the Raspberry Pi system helps users fix the network related issues. There are two methods to restart the network on the Raspberry Pi system. One can be done by installing the Network Manager tool while other is through nmcli command where the users have to turn off the networking option first and turn on again to fix the problem.

About the author

Zahra Zamir

An Electronics graduate who loves to learn and share the knowledge, my passion for my field has helped me grasp complex electronics concepts and now I am here to share them with others.