To configure a static IP address you need to creat a YAML file by cml:
touch /etc/netplan/01-network-configuration.yaml
Then, open it paste this content:
network:
version: 2
renderer: NetworkManager
ethernets:
eth0:
addresses:
- 192.168.1.21/24
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
routes:
- to: default
via: 192.168.1.1
Now to applt the changes by command:
netplan apply
To check IP you can use:
ip a