news
Virtual Private Cloud — New service for secure your business

How to Restart Network in Ubuntu

EN
Ekaterina Neverova
June 8, 2020

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.

Start Your Cloud Journey Migration made simplified. Take the first step right now.
We use cookies to provide our services and for analytics and marketing. To find out more about our use of cookies, please see our Privacy Policy. By continuing to browse our website, you agree to our use of cookies.