

To change the IP address inside Ubuntu from the CLI you need to modify work out what network adapter to modify, modify the netcfg config file and restart the network
Get interface name
First work out what network adapter is you want to modify. In this instance we want to modify eth0
ip addr
Modify config
Edit the netcfg file. When modifying, only use spaces as tabs are not allowed.
sudo nano /etc/netplan/01-netcfg.yaml
Original one looks like this
Modify it to the following (change to suit your details). In this example 192.168.0.10 is set as the IP address, 192.168.0.1 is set as the gateway and we are using 8.8.4.4 and 8.8.8.8 as google email servers.
Apply changes
Once you are happy with your changes. Apply them using the following script
sudo netplan apply
Once applied and you can confirm there are no errors, check the IP address has been applied
ip addr
Debugging
If the config doesn't apply correctly you can debug using the following commands
sudo netplan --debug apply