Edit the netplan configuration:
sudo nano /etc/netplan/01-netcfg.yaml
Insert the following:
network:
version: 2
renderer: networkd
ethernets:
eth0:
addresses:
- 10.10.10.1/24
nameservers:
addresses: [1.1.1.1, 8.8.8.8]
routes:
- to: default
via: 10.10.1.1
Run the following command to enable the new static IP (no restart needed):
sudo netplan apply