Use the following command:
sudo nano /etc/netplan/01-netcfg.yaml
Change the settings from nano editor
To save : Press CTRL + O
To exit : Press CTRL + X
To test the settings, use the following command:
sudo netplan try
Make sure no error message appear.
If encounter an error message, use debug
sudo netplan -debug generate
Once no error, apply the changes
sudo netplan apply
Restart the server if require for changes to take plan.