There exist various ways of restarting network on Ubuntu 20.04. Possibly the simplest way would be to restart network from GUI such as GNOME. Other ways would include the use of the command line and commands netplan
and ip
. Finally, the NetworkManager command line tool nmcli
or the System V init scripts can be used to successfully restart network on Ubuntu 20.04 Focal Fossa.
In this tutorial the reader will be provided with comprehensive information on:
- How to restart network from GUI
- How to restart network using the
netplan
command - How to restart network using the
ip
command - How to restart network using System V init scripts
- How to restart network by using the NetworkManager command line tool
nmcli
Software Requirements and Conventions Used
Category | Requirements, Conventions or Software Version Used |
---|---|
System | Installed or upgraded Ubuntu 20.04 Focal Fossa |
Software | N/A |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions |
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ – requires given linux commands to be executed as a regular non-privileged user |
Restarting network on Ubuntu 20.04 LTS Focal Fossa step by step instructions
Restarting network from GUI desktop on Ubuntu 20.04
In case you are running the default GNOME GUI on your Ubuntu 20.04 the simplest way to restart the network is to click on the top-right network icon:
Restarting network from command line on Ubuntu 20.04
The first step is to check how the system networking is managed. There are few options how your networking may be managed:by the NetworkManager
or by the networkd
daemon. The commands you choose from the below list will be only effective when selected for the appropriate network management configuration.
The first and recommended command to restart your network is:
$ sudo netplan apply
The above command will restart your network regardless network management configuration settings.
Network restart for networkd managed systems
The following commands will restart network interface enp0s3
$ sudo ip link set enp0s3 down $ sudo ip link set enp0s3 up
Network restart for NetworkManager managed systems
$ sudo nmcli networking off $ sudo nmcli networking on
Alternatively you can try to restart your network with System V init script:
$ sudo /etc/init.d/network-manager restart
Network restart for interfaces listed in /etc/network/interfaces
For all devices listed in the /etc/network/interfaces
the following command can be used to restart the listed network interfaces. Please note that if the ifdown
or ifup
command is missing you need to install the ifupdown
package first.
$ sudo ifdown -a $ sudo ifup -a