I want to peer connect between two bridges in my netplan configuration.
Under iproute2
the commands would be:
ip link add dev vethb1 type veth peer name vethb2
brctl addif br1 vethb1
brctl addif br2 vethb2
I'm porting from OpenVSwitch, so it's possible I'm thinking about this the wrong way.
Unfortunately, the netplan documentation doesn't seem to cover all device types, particularly veth
. Although it does mention veth
in terms of matching, so there's some part of netplan that must know what it means.
I've tried doing a vlan
with no id
but it expects an id.
Creating an ethernet
doesn't seem to accept a type
or peer
attribute. Networkd calls this kind
but that isn't an accepted key either.
What does a veth peer
link look like in a netplan config?
@slangasek is correct. As of 0.39 there is no support in the netplan yaml. However,
netplan
is based onsystemd-networkd
and plays nicely with it. So here's the solution I came up with:Create a file called
/etc/systemd/network/25-veth-b1b2.netdev
with the contents:Then add to your
/etc/netplan/01-netcfg.yaml
Under:
Add:
What this does is tells netplan to expect interfaces from somewhere called
vethb1
andvethb2
. ({}
is an empty match.match: {}
works also, but leaving it blank or justmatch:
causes a parsing error.)Then you can add those interfaces to your bridge:
Then rebuild your netplan config and restart systemd-networkd:
As of netplan 0.39, there is no support for configuring veth devices through netplan yaml. This is currently under consideration for implementation in a future release.