Is it possible to directly connect two VM NICs together?

ChrisPSD

New Member
Apr 3, 2025
3
0
1
I've tried to search for this, but with little success. My thinking is this isn't possible.

I need to directly connect two VMs to one another, without a virtual switch in between. This is so I can perform some LACP testing against a virtual switch.

Any thoughts would be appreciated.
 
Last edited:
To add to this, I've tried to work around this by using group_fwd_mask to allow the LACP packets through the bridge. The kernel seems to be blocking this. Any idea why this has been restricted? Any thoughts on whether I can enable this in the kernel?

Code:
root@pve:~# echo 0x4 > /sys/class/net/vmbr4/bridge/group_fwd_mask
-bash: echo: write error: Invalid argument
root@pve:~# echo 0x0004 > /sys/class/net/vmbr4/bridge/group_fwd_mask
-bash: echo: write error: Invalid argument
root@pve:~# echo 4 > /sys/class/net/vmbr4/bridge/group_fwd_mask
-bash: echo: write error: Invalid argument

This isn't blocking other bitmasks. LLDP, for example:

Code:
root@pve:~# echo 0x4000 > /sys/class/net/vmbr4/bridge/group_fwd_mask
root@pve:~# cat /sys/class/net/vmbr4/bridge/group_fwd_mask
0x4000
 
Last edited:
I've worked around this using an OVS bridge instead:

Code:
auto ovsbr0
iface ovsbr0 inet manual
        ovs_type OVSBridge
        up ovs-ofctl add-flow ovsbr0 "table=0, dl_dst=01:80:c2:00:00:02, actions=flood"

It would be good if this was possible using the native linux bridge. Restricting the bitmasks in the kernel feels like a restrictive limitation given that this is a virtualisation platform where certain network implementations may be required. I appreciate that forwarding LACPDUs through a bridge is technically not "correct", but if anyone is applying a custom bitmask to the bridge, they aren't doing this without understanding why they're doing it, so it should be assumed this is safe in the given scenario.