Change IP in Ubuntu server 18.04
The configuration files are stored in 50-cloud-init.yaml
(If it does not exist, using command sudo netplan generate
to generate it)
network:
ethernets:
eno1:
addresses: []
dhcp4: true
optional: true
enp4s0f1: # change the interface which you are working on
addresses: [192.168.100.45/24] # /24 is netmask
gateway4: 192.168.100.1
dhcp4: no # use static ip
nameservers:
addresses: [8.8.8.8]
version: 2
Apply the configuration
sudo netplan apply