We should edit config file netplan „/etc/netplan/50-cloud-init.yaml” and add below lines:
network:
ethernets:
ens18:
addresses:
- 10.10.10.100/24
dhcp6: false
routes:
- to: default
via: 10.10.10.1
nameservers:
addresses:
- 10.10.20.2
- 1.1.1.1
search: []
optional: true
version: 2

assumptions:
- IP address
10.10.10.100
- netmask 255.255.255.0
- gateway 10.10.10.1
- nameserver 10.10.20.2 and 1.1.1.1
- interface name -> ens18
After editing the above config file, we should check the configuration using the command „netplan try” and apply after the positive test with the command „netplan apply„.