16.02.2026

Configure Network Interfaces in Ubuntu 18.04: Netplan vs /etc/network/interfaces (Static IP, DNS, Gateway)

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 covered two ways to configure network interfaces in Ubuntu 18.04: the modern Netplan approach and the legacy /etc/network/interfaces method. In most Ubuntu 18.04 installations, Netplan is the default and recommended option, using YAML files in /etc/netplan/ to generate configuration for systemd-networkd or NetworkManager. It’s flexible, consistent, and safer for remote servers—especially when you use netplan try to avoid losing SSH access. The traditional /etc/network/interfaces workflow is still useful in environments that explicitly rely on ifupdown, but it’s not the primary network stack on a standard 18.04 setup. By understanding both methods, you can confidently assign static IPs, gateways, and DNS, and quickly troubleshoot connectivity issues on Ubuntu servers.

FAQ