The NetworkManager service is the responsible to handle network on a Ubuntu system. NetworkManager daemon is available for most of modern Linux kernel-based and other Unix-like operating systems.
You can use NetworkManager for the configuration of the following connections types like: Ethernet, wireless, mobile broadband, and DSL and PPPoE (Point-to-Point over Ethernet). It also allows the configuration of the network aliases, static routes, DNS information and VPN connections on Linux systems.
This tutorial will help you to Start/Stop and Restart network services on Ubuntu Linux system.
Restart Network on Ubuntu 20.04
You can restart the network service with the command line interface as well as using the Desktop interface. Here are the three methods available to restart network service on Ubuntu system.
Method 1 – Using NetworkManager Service (CLI)
NetworkManager is a daemon for simplifying the networking on Unix-like systems. It provides a rich API for the applications to query and control network configuration and state.
Use the followings commands to start/stop network service on a Ubuntu Linux system.
sudo systemctl start NetworkManager
sudo systemctl stop NetworkManager
Use the followings commands to restart network service.
sudo systemctl restart NetworkManager
Method 2 – Using nmcli Tool (CLI)
The
nmcli
is a command-line utility for managing NetworkManager on a Ubuntu system. You can simply use this utility to stop/start network service on a Ubuntu system.WARNING – Do not runnmcli networking off
for the remotely connected systems. This will disable the NetworkManager network connections on the machine and you will lose connection.sudo nmcli networking off
sudo nmcli networking on
The above command will disable/enable the network connections on Ubuntu Linux system.
Method 3 – Using Desktop
For the Ubuntu desktop users, Users can directly enable disable networking from the interface. To disable networking:
- Move mouse pointer to top-right corner.
- Click on triangle icon button.
- Click Wired Connected option.
- Then click Turn Off.
To enable the networking on Ubuntu follow below steps:
- Move mouse pointer to top-right corner.
- Click on triangle icon button.
- Click Wired Off option.
- Then click connect.
Conclusion
In this tutorial, you have learned 3 methods restart network services on a Ubuntu system.
2 Comments
I’m shocked how confused this entry is, there is a clear and properly working way to restart the networking on Ubuntu 20.04, most of these articles show 10 different ones, they don’t seem to know which network system Ubuntu 20.04 uses, very very strange.
restarting NetworkManager does not necessarily read the new config from /etc/NetworkManager/system-connections/W*
I found that nmcli is best – but iftrequires 2 commands and the off kills your interactive PuTTy
Here is a way I reloaded a new config even though I was in PuTTy (of course had to re login with new PuTTy after the IP change)
root@ubuntu204:~# vi /etc/NetworkManager/system-connections/W*
root@ubuntu204:~# /root/scripts/schedule_nmcli_reloadconfigs.sh_byat.sh
root@ubuntu204:~# cat /root/scripts/schedule_nmcli_reloadconfigs.sh_byat.sh
#!/bin/bash
echo /root/scripts/nmcli_reloadconfigs.sh | at now + 1 minutes 2> /dev/null
root@ubuntu204:~#
root@ubuntu204:~/scripts# cat nmcli_reloadconfigs.sh
#!/bin/bash
/usr/bin/nmcli c reload
sleep 2
/usr/bin/nmcli networking off
sleep 2
/usr/bin/nmcli networking on
root@ubuntu204:~/scripts#
When ready just execute:
/root/scripts/schedule_nmcli_reloadconfigs.sh_byat.sh