30.11.2025

How to Configure Network Interfaces in Ubuntu 18.04 Using Netplan and Traditional Methods

Network interface configuration in Ubuntu 18.04 via netplan

Network management in Ubuntu 18.04 has undergone significant changes compared to earlier releases. While the traditional configuration file /etc/network/interfaces still exists, it now plays a minimal role, serving mainly as a reference. The actual network settings are now managed through YAML files located in the /etc/netplan directory, which have become the primary method for defining and controlling network interfaces:

Let's look at this:

ls /etc/netplan

Then take a look at the file structure:

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

The netplan settings is described in YAML (Yet Another Markup Language). Let's look inside:

ifconfig -a

To activate new settings, run this:

netplan apply

Network configuration without netplan

Before the setup, I advice you to clarify which interfaces are really present in the system:

ifconfig -a

In the screenshot above, you can see that there are two interfaces without assigned IP's present, cause the machine is waiting for settings from the DHCP server. In a situation where there is no such DHCP-server in the network segment, you should assign the IP manually. So, change the config-file so that it looks like the one shown in the picture:

sudo nano /etc/network/interfaces

Let's talk about the parameters:

To confirm the changes, you should run this:

sudo /etc/init.d/networking restart

After the service restart, the computer should be available via assigned IP address. If not, reboot the server entirely, it will help.

Conclusion

In this guide, we explored two approaches for configuring network interfaces in Ubuntu 18.04: using Netplan and the traditional /etc/network/interfaces method. Netplan provides a modern, YAML-based configuration system that integrates seamlessly with NetworkManager and systemd-networkd, making it easier to manage network settings. At the same time, the classic method remains available for scenarios where manual static configuration is required or DHCP is not accessible. By understanding both approaches, you can confidently manage and troubleshoot network connectivity on Ubuntu servers, ensuring stable and reliable access for your system and applications.

FAQ