How to configure the network in Ubuntu Server with Netplan easily

Managing a server

One of those things that everyone should take into account at some point to learn, refers to the operation of a web server. When talking about servers, we do not refer only to a web server, since a server can also be used for the storage or containment of a database, for example.

managing a server

In this sense, it is important to note that a server perfectly adapts to the description of a technological and digital tool, since it should not necessarily be related to a physical device, since the necessary efforts have been made to turn it into a powerful program to facilitate its handling.

Let’s learn more about Ubuntu Server

One of the most powerful servers you could use is the Linux operating system , more specifically in its Ubuntu distribution.

This open source operating system has great benefits, due to the incredible collaboration on the part of its large community of users, who make important contributions to the improvement and optimization of each of its tools.

So in this case, how about we explore some Ubuntu Server features that will help you set up a network easily? It will only be a matter of putting into practice all the knowledge you acquire here.

Let’s also talk about Netplan

To achieve the objective of configuring a network thanks to the benefits offered by the Ubuntu Server Linux distribution, it is necessary to talk about the most outstanding utility of the aforementioned operating system and that is Netplan.

This tool is the one that will allow you to configure the network , (by means of quick and simple commands), to which you are connected.


It is important to note that this utility is included within the functions of the operating system, so you do not need to perform any type of download or installation to use it.

How to use

Netplan has made network interface configurations a thing of the past, implementing YAML functions to put a configuration file to work.

  • The Netplan configuration file may vary depending on the installed distribution. In this case, this file could be located using the command sudo nano /etc/netplan/01-netcfg.yaml.
  • If you do not know the name of your interface, enter the command sudo ip addr to obtain the necessary information to identify it.
  • Once you know the identity of your interface, proceed to use the file 01-netcfg.yaml, this file may also vary in its structure depending on the distribution you have.
  • After the previous step, a series of elements related to the network configuration will be displayed, which can be modified to suit your needs. Said list must have this structure:
    • network:
    • version: 2
    • renderer: networkd
    • ethernets:
    • eno1:
    • dhcp4: no
    • dhcp6: no
    • addresses:
    • –
    • gateway4:
    • nameservers:
    • search: [domain.local]
    • addresses: []
    • eno2:
    • dhcp4: no
    • dhcp6: no
    • addresses:
    • –
    • nameservers:
    • search: [domain.local]
    • addresses: []

Once the modifications that you think are pertinent or necessary have been made, all that remains is to proceed with updating or restarting the configuration file, for this, you must use the netplan apply command.

Configure your network easily with Netplan!

Thanks to this important utility that is part of Ubuntu, you will be able to configure your network in a much simpler way.

For all the configuration carried out by Netplan to be really effective, you must make sure you have all the information of your network, such as IP address or network mask. If you do not have more knowledge about these elements, you can always use a network calculator for it.

Leave a Reply

Your email address will not be published.

Back to top button