Configure network on Ubuntu 18.04

First find out what interfaces you have:

ip ling show

The Run the following command:

netplan generate

Then edit the file:

vim /etc/netplan/01-netcfg.yaml

The file should look like something like this:

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
 network:
   version: 2
   renderer: networkd
   ethernets:
           <Interface name>:
                   dhcp4: no
                   dhcp6: no
                   addresses: [<ip>/<bit mask>, ]
                   gateway4: <gateway>
                   nameservers:
                           addresses: [<dns1>, <dns2>]

Once this is done you need to apply the setting by:

netplan apply

This entry was posted in Linux, Ubuntu. Bookmark the permalink.