Applicable to:
- SolusVM
Question
During creating of custom Ubuntu KVM template you may want to deploy Ubuntu 18 virtual server using ISO image. In the case network interface will have new name type like ens0p1.
However, SolusVM uses old names for network interface when it configures network inside of the KVM virtual servers. How to configure Ubuntu 18 to use eth0 and switch back to /etc/network/interfaces file?
Answer
Ubuntu 18 uses netplan and networkd-dispatcher as a default. The steps below describes how to switch back to networking service and /etc/network/interface file
-
Connect to the server via SSH
-
Install system updates and ifupdown package
# apt-get update
# apt-get install ifupdown -
Configure /etc/network/interfaces file according to your requirements. Here is an example of minimal configuration:
# cat /etc/network/interfaces
# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.10.10.10
netmask 255.255.0.0
gateway 10.10.1.1
dns-nameservers 8.8.8.8 8.8.4.4Note: Interface name is eth0. Make sure that you replaced IP address, netmask and other parameters with actual values for your network
-
Apply the configuration:
# ifdown --force ens3 lo && ifup -a
-
Disable and remove unnecessary services:
# systemctl stop networkd-dispatcher
# systemctl disable networkd-dispatcher
# systemctl mask networkd-dispatcher
# apt-get purge nplan netplan.io
Then
-
Connect to the server via SSH
-
Edit grub file:
# nano /etc/default/grub
Before
CONFIG_TEXT: GRUB_CMDLINE_LINUX=""
After
CONFIG_TEXT: GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
-
Generate a new grub file:
# grub-mkconfig -o /boot/grub/grub.cfg
-
Reboot the server
Comments
0 commentsPlease sign in to leave a comment.