0. Introduction
I've just installed Ubuntu 18.04.4 LTS (server) on an old-ish Dell Poweredge 510 - formerly hosted Windows 2008R2.
The installer "mentioned" an issue with the network adapters. This system has two (eno1, eno2) adapters that were bonded in the Windows server. However, despite the installer's gripe, the system installed successfully - including a functional network.
As my first order of business, I decided to sort the installer's gripes about the network. I decided that bonding the two adapters would be a good idea, and perused some documentation showing how that was done. Unfortunately, I may have fallen into a "Netplan rabbit-hole", and so this Question is about how to get out! Here's what I did:
1. Edit the file /etc/cloud/cloud.cfg.d/50-curtin-networking.cfg
Following are the contents of this file as I found it (before ANY edits):
network:
ethernets:
eno1:
addresses:
- 192.168.1.74/24
gateway4: 192.168.1.1
nameservers:
addresses:
- 192.168.1.1
- 8.8.8.8
search:
- mylan.local
version: 2
I created a replacement for the file above. This is it:
network:
version: 2
ethernets:
eno1:
dhcp4: no
eno2:
dhcp4: no
optional: true
bonds:
bond0:
interfaces: [eno1, eno2]
addresses: [192.168.1.74/24]
gateway4: 192.168.1.1
nameservers:
addresses: [192.168.1.1, 8.8.8.8]
search: mylan.local
parameters:
mode: active-backup
primary: eno1
mii-monitor-interval: 100
2. Run commands to check the configuration:
$ sudo cloud-init clean
$ sudo cloud-init init
# errors, incl the following:
...
2020-03-31 04:58:22,849 - util.py[WARNING]: failed stage init
...
cloudinit.util.ProcessExecutionError: Unexpected error while running command.
Command: ['netplan', 'generate']
Exit code: 1
Reason: -
Stdout:
Stderr: /etc/netplan/50-cloud-init.yaml:13:15: Error in network definition: bond0: interface 'eno1' is not defined
- eno1
^
Note the file ref'd by stderr is /etc/netplan/50-cloud-init.yaml. But I did not edit this file.
OK - so the yaml file is apparently generated by the file I did edit. I decided against following this advice that advised editing the yaml file contrary to the information in the file! Instead, I opted to beat a hasty retreat! But that doesn't seem to have worked either:
3. Retreat! Restore the original .cfg file:
Fortunately, I saved a copy of the ORIGINAL file: /etc/cloud/cloud.cfg.d/50-curtin-networking.cfg
I restored this file to its original contents by simply copying the ORIGINAL file over the edited file:
$ sudo cp /etc/cloud/cloud.cfg.d/50-curtin-networking_ORIGINAL.cfg /etc/cloud/cloud.cfg.d/50-curtin-networking.cfg
I thought this would solve my problems, but when I run the commands again, I continue to get errors. In fact, I get the same errors I got with the edited .cfg file above!?
$ sudo cloud-init clean
$ sudo cloud-init init
# errors, incl the following: (same errors as above)
4. The Question
At this point, I feel like someone who's just stepped into quicksand - the more I move, the deeper I sink. So, I'm staying still, and asking for help. I believe Netplan must work at some level, but there's a lot of conflicting information out there.
What do I need do to restore my network to its original, as-installed configuration?
Where is the DEFINITIVE guidance for network configuration under Netplan?