Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to restart the network in Ubuntu

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to restart the network in Ubuntu. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.

1. Network manager service

This is the easiest way to restart the network from the command line. It is equivalent to restarting the network (restart the Network-Manager service) through a graphical interface.

Sudo service network-manager restart

At this point, the network icon disappears for a while and then reappears.

2 、 systemd

The service command is just one wrapper in this way (also an encapsulation of init.d series scripts and Upstart-related commands). The systemctl command is far more functional than the service command. Usually I prefer to use this command.

Sudo systemctl restart NetworkManager.service

At this point, the network icon will disappear for a while. If you want to learn about other options for systemctl, you can refer to the man help documentation.

3 、 nmcli

This is another tool on Linux that can manage the network. This is a powerful and practical tool. Many system administrators like to use this tool because it is very easy to use.

There are two steps in this method: shut down the network and then turn it on.

Sudo nmcli networking off

This shuts down the network and the network icon disappears. Next, turn on the network:

Sudo nmcli networking on

You can learn more about the use of nmcli through the man help documentation.

4. Ifup & ifdown

These two commands directly operate the network port and switch whether the network port can send and receive packets. This is one of the most important network commands you should know about in Linux.

Use ifdown to close all network ports, and then use ifup to re-enable network ports.

It is generally recommended to use these two commands together.

Sudo ifdown-a & & sudo ifup-a

Note: this method will not make the network icon disappear from the system tray, in addition, various network connections will be cut off.

Supplementary tool: nmtui

This is another method commonly used by system administrators. It is a text menu tool for managing the network in a command line terminal.

Nmtui

Open the following menu:

Nmtui Menu

Note: in nmtui, you can select options through the up and down arrow keys.

Select "Activate a connection":

Nmtui Menu Select "Activate a connection"

Press enter to open the connections menu.

Nmtui Connections Menu

Next, select the network preceded by an asterisk (*). In this case, it is MGEO72.

Select your connection in the nmtui connections menu.

Press enter. This will "disable" your network connection.

Nmtui Connections Menu with no active connection

Select the network you want to connect to:

Select the connection you want in the nmtui connections menu.

Press enter. This reactivates the selected network connection.

Nmtui Connections Menu

Press the Tab key twice and select "Back":

Select "Back" in the nmtui connections menu.

Press enter to return to the main menu of nmtui.

Nmtui Main Menu

Select "Quit":

Nmtui Quit Main Menu

Exit the interface and return to the command line terminal.

In this way, you have successfully restarted the network.

Restart the network through a graphical interface

Obviously, this is the easiest way for Ubuntu desktop users to restart the network. If this method doesn't work, you can try to restart the network using the command line mentioned above.

NM Mini Program is the system tray program logo of NetworkManager. We will use it to restart the network.

First, look at the top status bar. You will find a network icon in the system tray (because I use Wi-Fi, so here is a Wi-Fi icon).

Next, click the icon (you can also click the volume icon or the battery icon). Open the menu. Select Turn Off to shut down the network.

Restart network in Ubuntu

The network icon disappears in the status bar, indicating that you have successfully shut down the network.

Click the system tray again to reopen the menu, select "Turn On", and reopen the network.

Restarting network in Ubuntu

Congratulations! You've restarted your network now.

Other hints: refresh the list of available networks

If you are already connected to a network, but you want to connect to another network, how do you refresh the WiFi list and find other available networks? Let me show you.

Ubuntu does not have the option to "refresh the WiFi network" directly, it is a bit covert.

You need to open the configuration menu again and click "Select Network".

Refresh wifi network list in Ubuntu

Select the corresponding network to modify your WiFi connection.

You can't see a list of available wireless networks right away. After opening the list of networks, it will take about 5 seconds to display other available wireless networks.

The above is how to restart the network in Ubuntu. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 242

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report