1. Linux Command Line (terminal)

Edit the following file

sudo nano /etc/netplan/00-installer-config.yaml

Use the following structure to static IP

# This is the network config written by 'subiquity'
network:
version: 2
ethernets:
ens18:
dhcp4: no
addresses: [10.10.0.115/24]
gateway4: 10.10.0.1
nameservers:
addresses: [208.67.222.222,10.10.0.1]

Use the following structure to dynamic IP

# This is the network config written by 'subiquity'
network:
version: 2
ethernets:
ens18:
dhcp4: true

Try your configuration with the command:

sudo netplan try

Apply your configuration with the command:

sudo netplan apply