Removing the netplan.io package from my system running Ubuntu Server 20.04 LTS ("Focal Fossa") causes no immediate effects, i.e. the network keeps working, but the next time the server is restarted there is no network. That means Netplan is responsible for some aspect of configuration (obviously), and the OS is able to use the network, if it's properly configured.
Previous failed attempts
I have tried these steps to attempt to manually bring up the network without Netplan:
ifconfig eth0 up— Failed.It brings up some semblance of IPv6, but no IPv4; no network access.
dhclient eth0— Failed.Tried this next, hung forever, did nothing.
ifup— Failed.Command not found.
sudoedit /etc/network/interfaces— Failed.File not found.
Netplan configuration
Here is the configuration I extracted using netplan get while it was still installed:
network:
version: 2
ethernets:
eth0:
addresses:
- "<redacted>/24"
gateway4: <redacted>
It looks extremely basic, but I somehow can't find out how to apply it without keeping Netplan installed.
Desired outcome
My end goal is to get the network working automatically on system startup without Netplan installed. I cannot find any packages to try installing in order to facilitate this. I can only find guides on how to edit /etc/network/interfaces, but that isn't applicable here. On top of that, apt-file search cannot find any packages that contain that file, so I can't even make it applicable.
How do I keep Ethernet working without Netplan?
EDIT: I finally found a sequence of commands that properly configures the network:
ifconfig eth0 <address> netmask 255.255.255.0
route add default gw <gateway4> eth0
ifconfig eth0 up
DNS name resolution even works, too! Now I just need to find a way to perform this automatically on boot…maybe an @reboot cron job, but that feels hacky…