Switching from Netplan to ifupdown allows you to manage network configurations using the traditional /etc/network/interfaces method. This approach can be beneficial for compatibility with older scripts, applications, or personal preference. However, be aware that ifupdown is deprecated in many newer distributions, and removing Netplan may disrupt system components that rely on it. Unless you have specific requirements, it’s generally recommended to continue using Netplan.


Keep in mind that mPanel uses cloud-init and Netplan to update your networking configuration settings whenever changes are made within mPanel. Disabling Netplan and cloud-init means you will have to manually reconfigure your networking settings if you make changes via mPanel.

Important


Without disabling the cloud-init network config, configuration changes will revert upon restarting your server. To disable the network configuration file, create a new file named /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg containing:

network: {config: disabled}

Full instructions on disabling cloud-init can be found here:  https://support.binarylane.com.au/support/solutions/articles/11000123283-netplan-ip-configuration-for-ubuntu-22-04#Disable/Enable-the-cloud-init-network-configuration-file: 




TABLE OF CONTENTS




Ubuntu 22.04 / 24.04 & Debian 12:

  1. Install ifupdown:

    sudo apt update
    sudo apt install ifupdown
    


  2. Disable Netplan (Ubuntu) or systemd-networkd (Debian):

    • Ubuntu: Move existing Netplan configuration files to a backup directory:

      sudo mkdir /etc/netplan/backup
      sudo mv /etc/netplan/*.yaml /etc/netplan/backup/
      


    • Debian: Move systemd-networkd config files:

      sudo mkdir /etc/systemd/network/backup
      sudo mv /etc/systemd/network/*.network /etc/systemd/network/backup/
      


  3. Configure Network Interfaces:

    Open the network interfaces file for editing:

    sudo nano /etc/network/interfaces
    


    Add the following configuration:

    # Loopback network interface
    auto lo
    iface lo inet loopback
    
    # Primary network interface
    auto ens3
    iface ens3 inet dhcp
    


  4. Stop and Disable systemd-networkd:

    sudo systemctl stop systemd-networkd
    sudo systemctl disable systemd-networkd
    sudo systemctl stop systemd-networkd.socket
    sudo systemctl disable systemd-networkd.socket
    sudo systemctl stop systemd-networkd-wait-online
    sudo systemctl disable systemd-networkd-wait-online
    sudo systemctl mask systemd-networkd
    


  5. Restart Networking Service:

    sudo systemctl restart networking
    


  6. Ensure Netplan Is Not Managing Network Interfaces:

    networkctl status networking
    


    If Netplan is still active, you may see interfaces listed as “managed by Netplan”. Try rebooting your server. Also confirm whether you disabled cloud-init.

    We can confirm that ifupdown is handling networking because networking.service has successfully started and exited cleanly:

    ? networking.service - Raise network interfaces
         Loaded: loaded (/usr/lib/systemd/system/networking.service; enabled; preset: enabled)
         Active: active (exited) since Fri 2025-02-21 09:22:32 AEST; 8min ago
    
      systemd[1]: Starting networking.service - Raise network interfaces...
      ifup[657]: ifup: waiting for lock on /run/network/ifstate.ens3
      systemd[1]: Finished networking.service - Raise network interfaces.
    




Switching Back to Netplan (Ubuntu) or systemd-networkd (Debian 12)

  1. Remove ifupdown:

    sudo apt remove ifupdown
    


  2. Restore Netplan (Ubuntu) or systemd-networkd (Debian 12) Configuration:
    • Ubuntu:

      sudo mv /etc/netplan/backup/*.yaml /etc/netplan/
      


    • Debian 12:

      sudo mv /etc/systemd/network/backup/*.network /etc/systemd/network/
      


  3. Re-enable systemd-networkd:

    sudo systemctl unmask systemd-networkd
    sudo systemctl enable systemd-networkd
    sudo systemctl enable systemd-networkd.socket
    sudo systemctl enable systemd-networkd-wait-online
    sudo systemctl restart systemd-networkd
    


  4. Apply Netplan Configuration (Ubuntu Only):

    sudo netplan generate && sudo netplan apply
    


  5. Restart Networking Service:

    sudo systemctl restart networking
    


  6. Verify Networking is Restored:

    networkctl status
    


    If using Ubuntu, the output should indicate that Netplan is managing the interface.

    If using Debian, the output should show systemd-networkd managing the network.

  7. Reboot the Server (If Required):

    sudo reboot
    






For further guidance and support, refer to the official Ubuntu documentation on Configuring networks, or the Debian documentation on Network Setup.



If you require assistance, feel free to submit a support ticket at our helpdesk here: Submit a ticket | BinaryLane.