Is this really necessary?
In my homelab, I prefer to turn everything up to 11. That means I'm using bonds, bridges, jumbo frames, software-defined networking, etc. Maybe I'm reliving my glory days of working for a large public cloud.
I learned Linux in the Red Hat world, so Debian/Ubuntu networking has always struck me as a bit fiddly compared to Red Hat. In Debian or Ubuntu, IP address changes always seemed to require a reboot, and mistakes frequently led to fixing things from the out-of-band serial console.
But that has less to do with Debian and more to do with the venerable /etc/network/interfaces (ifupdown) method of configuring interfaces. There are other options
available in Debian now, and at the moment it seems netplan is the best choice.
And why is that?
- It doesn't block the serial console. No longer will I have to reboot into rescue mode because I screwed up an interfaces file.
- It has a safe way of previewing changes (
netplan generate). - It integrates with systemd.
Working Netplan config file from my lab
cat /etc/netplan/01-ovs.yaml
network:
version: 2
renderer: networkd
ethernets: # bonded interfaces
eth0:
mtu: 9000 # jumbo frame
eth1:
mtu: 9000
bonds:
bond0:
mtu: 9000
interfaces: [eth0,eth1]
openvswitch:
lacp: active # LACP bonding
other-config:
lacp-time: fast
bond-rebalance-interval: 0
parameters:
mode: balance-tcp
bridges:
ovsbr0:
interfaces: [bond0]
mtu: 9000
openvswitch:
external-ids:
iface-id: my_hostname
vlans:
stor16:
id: 16
link: ovsbr0
mtu: 9000
openvswitch: {}
addresses:
- 192.168.64.24/28
pxe32:
id: 32
link: ovsbr0
mtu: 1500
openvswitch: {}
mgmt64:
id: 64
link: ovsbr0
mtu: 9000
openvswitch: {}
addresses:
- 192.168.64.6/28
routes:
- to: default
via: 192.168.64.1
lab98:
id: 98
link: ovsbr0
mtu: 9000
openvswitch: {}
lb224:
id: 224
link: ovsbr0
mtu: 1500
openvswitch: {}
Goodbye, /etc/network/interfaces! I won't miss you.
References
- Netplan integration tests for OVS config - Gives you an idea of how the netplan files are translated into OVS commands.
- Github issue for OVS netplan docs - Not a perfect rendering of config, but it should help get you on the right track.