List of content you will read in this article:
You may see the network setting of your Ubuntu Linux system has been changed, or you may have problems when trying to connect to the network. You`ll be surprised if you know how a restart of the network in Ubuntu can fix such problems. That’s why restarting the network service on Ubuntu and other Linux systems is so imperative. Continue reading this article to learn multiple methods for restarting network settings in Ubuntu. Depending on your needs, you should choose one of the following methods:
- The command line
- The desktop or GUI
Method 1: Restart the network in Ubuntu using the command line
You can restart the network in Ubuntu by entering command lines in the Terminal. Using the Terminal for restarting network settings is more of an involved process. Several commands are at your disposal, most of which apply to restarting networks on other Linux distributions like Debian Linux. The following methods have changed slightly in different versions of Ubuntu. So, if one doesn't work, you can try another one of the commands. Generally, most of them work on Ubuntu 22.04 and Ubuntu 20.04 systems.
You`re already in Terminal when using the Ubuntu server edition. However, if you use the desktop edition, you must press "CTRL + ALT + T" to open the Terminal quickly. Done? Let`s start restarting the network with commands.
Network manager service command
If you`re using command lines to restart your Ubuntu network settings, the network manager service command is the easiest way. All you need to do is type the following command in Terminal: (for a moment, the network icon will disappear and reappear.)
sudo service network-manager restart
The systemd command
By using the systemd command, you can restart network services directly without any additional steps. You only need to enter the command below in Terminal: (Again, the network icon should disappear)
$ sudo systemctl restart NetworkManager.service
The nmcli command
If you`re running the latest versions of Ubuntu (Ubuntu 22.04, 20.04, and 18.04), the nmcli command also restarts network settings. This is another powerful and useful tool for handling Linux networks. As it`s easy to use, it's preferred by most people. Using this command has two steps. First, turn the network off with the following command:
sudo nmcli networking off
Then, enter this command to turn it on again:
sudo nmcli networking on
ifdown and ifup command
ifdown and ifup commands are must-known networking commands in Linux. Network interfaces are handled directly by these commands, changing their state from being able to transmit and receive data to one that cannot. You can combine both of these commands like this:
sudo ifdown -a && sudo ifup -a
However, you won't be able to connect to any network using this method since the network icon won't disappear in your systray.
The nmtui command
The nmtui command is installed on Ubuntu by default. It`s a managing network connection tool that provides an interactive environment. Use the following command to launch it:
$ sudo nmtui
Now you see an interface on the Terminal. Select ‘Activate a connection’. Then, tap on ‘Enter’.
After that, you need to deactivate the connection. To do this, select ‘deactivate’ and tap on ‘Enter’.
After deactivating the connection, select ‘Activate the connection’ to activate it again.
And in the last step, select ‘Quit’ to quit the app.
IP command
You can use the IP command to manage network connections on Ubuntu as another alternative. Before anything, find your target network interface with this command:
$ ip link show
For instance, enp0s3 is the target network. You will start the network by using the first command and then
Here, enp0s3 is our target network. Start the network by typing the following commands in the Terminal:
$ sudo ip link set enp0s3 down
$ sudo ip link set enp0s3 up
Method 2: Restart the network in Ubuntu using GUI (graphically)
Another method for restarting network settings on Ubuntu doesn`t require any command lines. This method is also easy to use if you`re an Ubuntu desktop user. This tutorial uses NM-applet (system tray applet indicator for NetworkManager) to restart the network. Let`s start with the steps:
Step 1: Before anything, check the top panel of your system and find a network icon in your system tray. Some systems display it as a Wi-Fi icon. Click on that icon.
Step 2: Now, the menu will be displayed. Click on the “Turn Off” button. (If the network turns off successfully, the network icon will disappear, and you can`t see that on the top panel.)
Step 3: Open the menu again from the systray and select “Turn On”
Now your system has been restarted successfully.
How to refresh the available network list
Imagine you already have a connection to a network, but now you want to join another. How do you connect to a new Wi-Fi network and see what`s available? I will provide you with the answer in this part of the article.
Hidden from view is that Ubuntu doesn't provide a direct option for refreshing wireless internet networks. So, open the settings menu and click the “Select Network” button.
The list of available networks will only appear after some time. Wait for around 5 seconds, and the other available wireless networks will be displayed. After that, you can select your network by clicking on it.
Conclusion
As a Linux enthusiast, you’re bound to encounter a serious problem with your network at some point. Fortunately, there are several ways to handle this issue. If your current problem persists, try rebooting or restarting your Ubuntu system. We hope the above options have provided you with a range of solutions!
I'm fascinated by the IT world and how the 1's and 0's work. While I venture into the world of Technology, I try to share what I know in the simplest way with you. Not a fan of coffee, a travel addict, and a self-accredited 'master chef'.