I have a number of VBox Ubuntu VMs that use a Bridged adapter for internet traffic and Host-only adapters for internal traffic. (Just a hobby.)
Using netplan, the only way I've been able to get both interfaces configured is to boot with one file for one interface then load the other file to configure the other interface.
Here's the file /etc/netplan/01-systemd-networkd.yaml
which is the only yaml file in the /etc/netplan directory.
network:
version: 2
ethernets:
enp0s3 :
addresses: [192.168.0.128/24]
gateway4: 192.168.0.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
I've tried a parallel entry for enp0s8 that includes all the fields and that produced a strange result whereby the enp0s3 had two IP6 addresses and the enp0s8 had none and neither could communicate even with their gateway.
So how do we do this?
Thanks
This works. I would rather the nameservers and gateway at a higher level so that they're not associated with one of the interfaces, but perhaps I'm missing something.
--