Actions

Network Config

In Ubuntu 18.04 the network configuration works different than in the previous Ubuntu versions. In this tutorial we show you how you can assign a static ip-address to your server.

File

The config file can be found in the "netplan" directory.

cd /etc/netplan
ls -la

The config files are not named the same in different servers, but it will be the file with the ".yaml" ending.

nano *.yaml

This is how your file should look:

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: no
      dhcp6: no
      addresses: [192.168.1.70/24]
      gateway4: 192.168.1.1
      nameservers:
        addresses: [192.168.1.1, 1.1.1.1, 1.0.0.1]

Fill in the parameters with the correct addresses. Some parameters may differ from this example. Only change the addresses and dhcp options.

Command

Confirm your configuration with the following command:

sudo netplan apply