How to Restart a Network in Ubuntu

本文介绍了如何在Ubuntu系统中使用命令行和图形用户界面两种方式重启网络,包括使用`network-manager`、`systemctl`、`nmcli`以及图形界面的NM-applet,解决网络连接问题。详尽的方法有助于不同需求的用户解决网络故障。

https://itsfoss.com/restart-network-ubuntu/

How to Restart a Network in Ubuntu [Beginner’s Tip]

Last updated October 29, 2020 By Sergiu 12 Comments

You’re using an Ubuntu-based system and you just can’t seem to connect to your network? You’d be surprised how many problems can a simple restart fix.

In this article, I’ll go over multiple ways you can restart network in Ubuntu and other Linux distributions, so you can use whatever suits your needs. The methods are basically divided into two parts:

Ubuntu Restart Network

Restart network in Ubuntu using command line

If you are using Ubuntu server edition, you are already in the terminal. If you are using the desktop edition, you can access the terminal using Ctrl+Alt+T keyboard shortcut in Ubuntu.

Now you have several commands at your disposal to restart network in Ubuntu. Some (or perhaps most) commands mentioned here should be applicable for restarting network in Debian and other Linux distributions as well.

1. network manager service

This is the easiest way to restart your network using the command line. It’s equivalent to the graphical way of doing it (restarts the Network-Manager service).

sudo service network-manager restart

The network icon should disappear for a moment and then reappear.

 

 

 

 

 

2. systemd

The service command is just a wrapper for this method (and also for init.d scripts and Upstart commands). The systemctl command is much more versatile than service. This is what I usually prefer.

sudo systemctl restart NetworkManager.service

The network icon (again) should disappear for a moment. To check out other systemctl options, you can refer to its man page.

3. nmcli

This is yet another tool for handling networks on a Linux machine. It is a pretty powerful tool that I find very practical. Many sysadmins prefer it since it is easy to use.

 

There are two steps to this method: turning the network off, and then turning it back on.

sudo nmcli networking off

The network will shut down and the icon will disappear. To turn it back on:

sudo nmcli networking on

You can check out the man page of nmcli for more options.

4. ifup & ifdown

This commands handle a network interface directly, changing it’s state to one in which it either can or can not transmit and receive data. It’s one of the must know networking commands in Linux.

To shut down all network interfaces, use ifdown and then use ifup to turn all network interfaces back on.

A good practice would be to combine both of these commands:

sudo ifdown -a && sudo ifup -a

Note: This method will not make the network icon in your systray disappear, and yet you won’t be able to have a connection of any sort.

Bonus tool: nmtui (click to expand)

That’s it! You have successfully restarted your network

Restart network in Ubuntu graphically

This is, of course, the easiest way of restarting the network for Ubuntu desktop users. If this one doesn’t work, you can of course check the command line options mentioned in the previous section.

 

NM-applet is the system tray applet indicator for NetworkManager. That’s what we’re going to use to restart our network.

First of all, check out your top panel. You should find a network icon in your system tray (in my case, it is a Wi-Fi icon, since that’s what I use).

Go ahead and click on that icon (or the sound or battery icon). This will open up the menu. Select “Turn Off” here.

Restart network in Ubuntu

Turn off your network

The network icon should now disappear from the top panel. This means the network has been successfully turned off.

Click again on your systray to reopen the menu. Select “Turn On”.

Restarting network in Ubuntu

Turn the network back on

Congratulations! You have now restarted your network.

Bonus Tip: Refresh available network list

Suppose you are connected to a network already but you want to connect to another network. How do you refresh the WiFi to see what other networks are available? Let me show you that.

Ubuntu doesn’t have a ‘refresh wifi networks’ option directly. It’s sort of hidden.

You’ll have to open the setting menu again and this time, click on “Select Network”.

Refresh wifi network list in Ubuntu

Select Network to change your WiFi connection

 

Now, you won’t see the list of available wireless networks immediately. When you open the networks list, it takes around 5 seconds to refresh and show up other available wireless networks.

Select another wifi network in Ubuntu

Wait for around 5- seconds to see other available networks

And here, you can select the network of your choice and click connect. That’s it.

Wrapping Up

Restarting your network or connection is something that every Linux user has to go through at some point in their experience.

We hope that we helped you with plenty of methods for handling such issues!

What do you use to restart/handle your network? Is there something we missed? Leave us a comment below.

 

 

 

 

Like what you read? Please share it with others.

【四旋翼无人机】具备螺旋桨倾斜机构的全驱动四旋翼无人机:建模与控制研究(Matlab代码、Simulink仿真实现)内容概要:本文围绕具备螺旋桨倾斜机构的全驱动四旋翼无人机展开研究,重点探讨其系统建模与控制策略,结合Matlab代码与Simulink仿真实现。文章详细分析了无人机的动力学模型,特别是引入螺旋桨倾斜机构后带来的全驱动特性,使其在姿态与位置控制上具备更强的机动性与自由度。研究涵盖了非线性系统建模、控制器设计(如PID、MPC、非线性控制等)、仿真验证及动态响应分析,旨在提升无人机在复杂环境下的稳定性和控制精度。同时,文中提供的Matlab/Simulink资源便于读者复现实验并进一步优化控制算法。; 适合人群:具备一定控制理论基础和Matlab/Simulink仿真经验的研究生、科研人员及无人机控制系统开发工程师,尤其适合从事飞行器建模与先进控制算法研究的专业人员。; 使用场景及目标:①用于全驱动四旋翼无人机的动力学建模与仿真平台搭建;②研究先进控制算法(如模型预测控制、非线性控制)在无人机系统中的应用;③支持科研论文复现、课程设计或毕业课题开发,推动无人机高机动控制技术的研究进展。; 阅读建议:建议读者结合文档提供的Matlab代码与Simulink模型,逐步实现建模与控制算法,重点关注坐标系定义、力矩分配逻辑及控制闭环的设计细节,同时可通过修改参数和添加扰动来验证系统的鲁棒性与适应性。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值