In this article, we will discuss how to switch back to the traditional
/etc/network/interfaces method for configuring the network in Ubuntu 18.04, instead of using the newer netplan approach.
To switch back to using the traditional
/etc/network/interfaces method for configuring the network in Ubuntu 18.04, you need to reinstall the
ifupdown package, configure the
/etc/network/interfaces file with your desired network settings, make the configuration effective using specific commands, disable and remove netplan-related services, update the DNS resolver configuration, and restart the systemd-resolved service.
Ubuntu 18.04 introduced a new method of network configuration called netplan. However, some users may prefer the older, more familiar method of configuring network interfaces using the
/etc/network/interfaces file. Here, we will guide you through the process of reverting back to this method.
Reinstalling the ifupdown package
The first step is to reinstall the
ifupdown package, which provides the
ifdown commands used for configuring network interfaces. You can do this by running the following commands in the terminal:
# apt-get update
# apt-get install ifupdown
apt-get update command updates the list of available packages from the repositories, while
apt-get install ifupdown installs the
Configuring the /etc/network/interfaces file
Next, you need to configure the
/etc/network/interfaces file with your desired network settings. Here’s an example configuration:
# The loopback network interface
iface lo inet loopback
iface eth0 inet static
dns-nameservers 126.96.36.199 188.8.131.52
In this file,
auto is used to bring interfaces up at system startup.
iface is used to define the configuration for an interface. The
inet keyword is followed by either
dhcp, depending on whether you want to use a static IP address or obtain one automatically via DHCP.
Making the configuration effective
To make the configuration effective without rebooting, run the following commands:
# ifdown --force eth0 lo && ifup -a
# systemctl unmask networking
# systemctl enable networking
# systemctl restart networking
ifup commands bring network interfaces down and up, respectively. The
--force option forces the commands to run even if there are errors. The
systemctl commands are used to manage the networking service.
Disabling and removing unwanted services
Next, you need to disable and remove the services related to netplan:
# systemctl stop systemd-networkd.socket systemd-networkd \
# systemctl disable systemd-networkd.socket systemd-networkd \
# systemctl mask systemd-networkd.socket systemd-networkd \
# apt-get --assume-yes purge netplan.io
These commands stop, disable, and mask the systemd-networkd and networkd-dispatcher services, which are used by netplan. The
apt-get purge command removes the netplan.io package and its configuration files.
Updating the DNS resolver configuration
Finally, you need to update the DNS resolver configuration by editing the
Then restart the systemd-resolved service:
# systemctl restart systemd-resolved
This updates the system’s DNS resolver to use Google’s DNS servers (184.108.40.206 and 220.127.116.11).
By following these steps, you can remove netplan and switch back to using
/etc/network/interfaces for network configuration in Ubuntu 18.04. Remember to adapt the values in the configuration file according to your specific network setup.
Switching back to the traditional method of network configuration in Ubuntu 18.04 may seem daunting, but with these steps, it can be a straightforward process. Remember, it’s always important to back up any important data before making significant system changes. Happy networking!
Yes, you can switch back to using /etc/network/interfaces in Ubuntu 18.04 by following the steps outlined in this article.
Netplan is a newer method of network configuration introduced in Ubuntu 18.04, while /etc/network/interfaces is the traditional method. Netplan uses YAML files for configuration, while /etc/network/interfaces uses a plain text file. Netplan also provides more flexibility and advanced features compared to /etc/network/interfaces.
Some users may prefer the familiarity and simplicity of the /etc/network/interfaces method for configuring network interfaces. It may also be necessary to switch back if you are using software or tools that are not compatible with netplan.
Switching back to /etc/network/interfaces should not cause any issues if done correctly. However, it is always recommended to backup your important data before making any significant system changes.
Yes, you can switch back to netplan if you decide to revert the changes. Simply follow the instructions provided by Ubuntu’s documentation or consult relevant resources on how to configure netplan.
To update the network settings in /etc/network/interfaces, you need to edit the file using a text editor and modify the desired configuration parameters such as IP address, netmask, gateway, and DNS servers. Save the changes and then restart the networking service for the new settings to take effect.
No, you do not need to restart your computer after switching back to /etc/network/interfaces. You can make the configuration effective without rebooting by following the steps outlined in the article.
No, you cannot use both netplan and /etc/network/interfaces simultaneously. Ubuntu uses netplan as the default method for network configuration in 18.04, so if you switch back to /etc/network/interfaces, netplan will be disabled.