1

I'm trying to set up a Linux bridge that includes a VLAN interface on my Fedora system. My goal is to use this bridge with virt-manager to create multiple VMs, each with an interface in the bridge that can communicate on a specific VLAN (VLAN ID 12).

My physical interface is enp5s0, and I've created a VLAN interface enp5s0.12 for VLAN ID 12. I'm using NetworkManager and the nmcli command to manage my network connections.

Here are the steps I've followed:

Created the VLAN interface:

nmcli con add type vlan con-name enp5s0.12 dev enp5s0 id 12

Created the bridge:

nmcli con add type bridge con-name br0
nmcli con modify br0 bridge.stp no

Brought the bridge up:

nmcli con up br0

Added the VLAN interface to the bridge:

nmcli con add type bridge-slave con-name br0-enp5s0.12 ifname enp5s0.12 master br0

However, when I try to bring up the br0-enp5s0.12 connection, I get the following error:

Error: Connection activation failed: No suitable device found for this connection (device enp5s0 not available because profile is not compatible with device (mismatching interface name)).

I have checked and all my connections (enp5s0.12, br0, and br0-enp5s0.12) are set to autoconnect. Even after rebooting the system, the br0 interface does not appear when I run ip addr show br0, indicating that the bridge isn't up. I'd appreciate any guidance on how to resolve this issue. Please let me know if there's any other information I can provide that might be helpful.

a-kodez
  • 11
  • 2

1 Answers1

0

I found a way to make this work for me, hopefully it can also help someone else.

first create the VLAN interface:

nmcli con add type vlan con-name enp5s0.12 dev enp5s0 id 12

then create the bridge:

nmcli con add type bridge con-name br0 ifname br0

then add the VLAN enp5s0.12 to the bridge br0:

nmcli con modify enp5s0.12 master br0

then set the bridge to up

nmcli con up br0

then set the VLAN interface to up

nmcli con up enp5s0.12

after this I saw the DHCP server on the 12 network hand an IP address to my bridge br0

then for creating the libvirt network I made a file with this content:

<network>
  <name>demo-net</name>
  <forward mode="bridge" />
  <bridge name="br0" />
</network>

and then ran:

virsh net-define ./demo-net.xml
virsh net-start demo-net
virsh net-autostart demo-net

After this I could create VMs with virt-manager that can communicate on the VLAN 12 network

a-kodez
  • 11
  • 2