Configuring Ubuntu Server 20.04 LTS gateway

Posted on Wed 20 October 2021 in Ubuntu

The current version of Ubuntu Server 20.04 LTS uses netplan in order to configure the network. If it doesn't use cloud-init to provision the network, the network configuration will be in a YAML file in /etc/netplan. There you can change the network parameters, such as the default gateway if you have a fixed connection.

After changing them, run this command to apply them (remember that you may disconnect from the network, so don't run it from a remote connection!):

sudo netplan apply

A more detailed explanation can be found in this very helpful post at linuxize.