I am trying to migrate from /etc/network/interfaces to netplan and network-manager setup.
I am "almost" there.
My current setup with /etc/network/interfaces is as follows:
auto lo
iface lo inet loopback
auto bond0
iface bond0 inet manual
bond-slaves eno1 eno2
bond-primary eno1
bond-mode active-backup
bond-miimon 100
bond-downdelay 200
bond-updelay 40000
auto vlanbr10
iface vlanbr10 inet static
address 192.168.10.107
netmask 255.255.255.0
gateway 192.168.10.1
bridge-ports bond0.10
It is a server and I do the following things:
- create a bond with eno1 and eno2 with active-backup
- Add a bridge, that uses bridge-ports e.g from bond0 take vlan 10.
- Give that server an IP in that bridge that is inside vlan10
I have conjured up the following netplan config:
network:
version: 2
# Set ethernet interfaces configuration. Match based on mac-addresses
ethernets:
eno1:
match:
macaddress: xx:xx:xx:xx:x2
dhcp4: no
dhcp6: no
set-name: eno1
eno2:
match:
macaddress: xx:xx:xx:xx:x1
dhcp4: no
dhcp6: no
set-name: eno2
# Create a bond with the active ethernet interfaces that is running in active-backup mode.
bonds:
bond0:
interfaces: [eno1, eno2]
parameters:
primary: eno1
mode: active-backup
mii-monitor-interval: 100
down-delay: 200
up-delay: 40000
nameservers:
addresses:
- '8.8.8.8'
dhcp4: false
dhcp6: false
bridges:
vlanbr10:
interfaces:
- vlan10
addresses: [192.168.10.109/24]
parameters:
forward-delay: 0
stp: true
vlans:
vlan10:
id: 10
link: bond0
dhcp4: false
dhcp6: false
accept-ra: false
EDIT:
Adding more information.
netplan status
shows this output.
eno1 and eno2 is up and so is the bond0, but after that it gets a bit "gray".
When I am looking at the configuration of another server that is using interfaces file. Then it seems to be using bridge-ports functionality, as you can see ip a
result from another working server is below.
4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether d4:ae:52:b6:4b:3a brd ff:ff:ff:ff:ff:ff
5: vlanbr10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether d4:ae:52:b6:4b:3a brd ff:ff:ff:ff:ff:ff
inet 192.168.10.107/24 brd 192.168.10.255 scope global vlanbr10
valid_lft forever preferred_lft forever
inet6 fe80::d6ae:52ff:feb6:4b3a/64 scope link
valid_lft forever preferred_lft forever
6: bond0.10@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master vlanbr10 state UP group default qlen 1000
link/ether d4:ae:52:b6:4b:3a brd ff:ff:ff:ff:ff:ff
And this last image is the ip a
from the netplan testing machine.
As you can see, I can't really access vlan10 nor the other parts of the network. In interfaces file there is this bridge-ports option that I can't quite get my head around in netplan.
Seems like I got it working, will post result here soon as an EDIT.
I needed to also add the default gateway where i specify the IP address of the server under vlanbr10.
I also needed to specify the MAC address of the bridge, to be the same as the physical interface - bond0.
Courtesy here: https://askubuntu.com/questions/1285193/netplan-with-bonded-nics-and-vlans-and-bridges-not-working