Assumptions

  • Ubuntu 20.04+
  • netplan installed
  • NIC Bonding Optional


1. Firstly to save headaches run all commands as su

     sudo su


2. Backup the current configuration

     cp  /etc/netplan/00-installer-config.yaml  /etc/netplan/00-installer-config.yaml.tmp


3. Edit config file

     nano /etc/netplan/00-installer-config.yaml 


File Structure is:


(Format for bonded is similar)



4. Edit IP details


5. CTRL + X to save & exit


6. Test settings (optional)

       netplan try


7. Apply settings

       netplan apply



In case of broken networking

if the above breaks the network config, firstly revert settings and then run netplan apply

if this doesn't work, run these commands to revert files.


rm /etc/netplan/00-installer-config.yaml 

mv /etc/netplan/00-installer-config.yaml.tmp /etc/netplan/00-installer-config.yaml

netplan apply

reboot