News
Seven days of Black Friday madness — great deal from Serverspace!
Serverspace Black Friday
WB
June 8, 2020
Updated June 7, 2023

How to Restart Network in Ubuntu

Ubuntu

First you need to find out which network manager the system uses.

In this example we’re running Ubuntu 18.04 which uses Netplan to configure networks.

What is Netplan used for?

Netplan is a new command-line network configuration utility introduced in Ubuntu 17.10 to manage and configure network settings easily in Ubuntu systems. It allows you to configure a network interface using YAML abstraction. It works in conjunction with the NetworkManager and systemd-networkd networking daemons (referred to as renderers, you can choose which one of these to use) as interfaces to the kernel.

It reads network configuration described in /etc/netplan/*.yaml and you can store configurations for all your network interfaces in these files.

So the first thing to do is to check what configuration files do we have in /etc/netplan/
We can check this out by using the command:

ls /etc/netplan/

checking what configuration files do we have in /etc/netplan/

Here we can see configuration file called “50-cloud-init.yaml”.

Now we need to read it to see configuration:

cat /etc/netplan/50-cloud-init.yaml

In the Renderer we can see the “NetworkManager” – that’s our active network manager

In the Renderer we can see the “NetworkManager” – that’s our active network manager.

To restart it simply run:

sudo service network-manager restart

How to Restart Network in Ubuntu

And then to see it’s status run:

sudo service network-manager status

And then to see it’s status run

As we can see it’s active and running.

If you see “networkd” in the Renderer in the netplan configuration file you need to restart it with the command:

sudo systemctl restart systemd-networkd

If you see “networkd” in the Renderer in the netplan configuration file you need to restart it

And then to see it’s status run:

sudo systemctl status systemd-networkd

And then to see it’s status run

That’s all, network is restarted.

Vote:
5 out of 5
Аverage rating : 5
Rated by: 2
1101 CT Amsterdam The Netherlands, Herikerbergweg 292
+31 20 262-58-98
700 300
ITGLOBAL.COM NL
700 300
We use cookies to make your experience on the Serverspace better. By continuing to browse our website, you agree to our
Use of Cookies and Privacy Policy.