18.01.2026

How to Configure a Network Interface in Ubuntu 18.04 Using Netplan

Configuring a network interface is one of the first and most important steps when setting up Ubuntu Server 18.04. In this guide, we’ll show how to manage network settings using Netplan, the default network configuration tool in Ubuntu 18.04, and briefly cover the legacy ifupdown method. You’ll learn how to locate configuration files, apply changes, configure multiple interfaces, and troubleshoot common networking issues to ensure stable connectivity.

Configuring the network interface in Ubuntu 18.04 was a surprise to many. Although there exists, familiar to all, the configuration Linux network interfaces file - /etc/network/interfaces, it says:

Configuration via ifupdown has been replaced by netplan. Configuration via /etc/netplan. If you want to go back to ifupdown configure via command:

sudo apt install ifupdown

We will not install anything else. Set up what there is. First, look at the content of the directory /etc/netplan.

Let's see, what is in this file.

The configuration file is written in YAML. Netplan uses declarative YAML configuration files to define network settings, making Ubuntu network management more predictable and easier to automate. The settings shown in the example above were made at the stage of installing the operating system. Let's take a closer look.

We activate the current settings with the command:

netplan apply

We examined the main options. More setup examples are on the official website.

What if the system does not use netplan?

It's the old fashioned way. First we get a list of available interfaces:

ifconfig -a

In this case, there are 2 network interfaces without IP addresses (for now). Configured by DHCP. Let's move on to the settings.

sudo nano /etc/network/interfaces

A server receiving IP from a DHCP server is not a good solution. We bring the file to the form:

What does this mean.

The second and subsequent interfaces are configured in the same way or configured using a DHCP server. Apply settings:

sudo /etc/init.d/networking restart

If everything is done correctly, then we wait for the process of restarting the service.

In some cases, the configuration file may be correct, but the server does not change the IP address. In this case, restarting the server with the command helps:
sudo reboot

FAQ: Network Interface Configuration in Ubuntu 18.04