How to configure virtualization bridge on bond and VLAN with NetworkManager?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9
  • NetworkManager
  • KVM virtual machines
  • Bonding
  • VLAN

Issue

  • How to configure virtualization bridge on bond and VLAN with NetworkManager?
  • This system is connected to a switch with two NICs. On those switch ports, we have configured an untagged VLAN and a tagged VLAN. We are running some virtual guests that we do want to allow access to both of these VLANs.
  • How to create a network like:
net1 --+-- bond0 --+-- br0 (untagged bridge for guests)
net2 --'           '-- VLAN100 --> br100 (VLAN tagged bridge for guests)

Resolution

Create first bridge:

nmcli connection add type bridge ifname br0 ipv4.method disabled ipv4.never-default true ipv6.method ignore ipv6.never-default true 802-3-ethernet.mtu 1500 con-name br0

Create second bridge:

nmcli connection add type bridge ifname br100 ipv4.method disabled ipv4.never-default true ipv6.method ignore ipv6.never-default true 802-3-ethernet.mtu 1500 con-name br100

Create VLAN on top of bond (setting its bridge master):

nmcli connection add type vlan ifname bond0.100 dev bond0 id 100 ipv4.method disabled ipv4.never-default true ipv6.method ignore ipv6.never-default true 802-3-ethernet.mtu 1500 master br100 con-name bond0.100

Create bond (setting its bridge master):

nmcli connection add type bond ifname bond0 bond.options "mode=active-backup" ipv4.method disabled ipv4.never-default true ipv6.method ignore ipv6.never-default true 802-3-ethernet.mtu 1500 con-name bond0 master br0

Add slaves to bond:

nmcli connection add type ethernet ifname net1 con-name net1 master bond0
nmcli connection add type ethernet ifname net2 con-name net2 master bond0

Root Cause

The method to do this with NetworkManager is unclear from the product documentation.

Red Hat Private Bug 1768329 - Correct NetworkManager method to make slaves->bond->bridge plus vlan->bridge is unclear is open to either improve NetworkManager or improve the documentation around this configuration and general master relationships and interface creation order in NM.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments