1. set gateway
# check route
$ ip route show
# set default route
$ route add default gw [IP]
2. set DNS
# edit file /etc/netplan/xxx.yaml
network:
version: 2
ethernets:
ens18:
dhcp4: no
addresses: [192.168.31.12/24]
nameservers:
addresses: [xxxx, xxxx]
# save and call command below
$ sudo netplan apply
# check gw, dns
$ sudo resolvectl status