Skip to content

jdlayman/pve-hookscript-sriov

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Proxmox Hookscript for FDB Management

As described in https://bugzilla.redhat.com/show_bug.cgi?id=1067802, when a linux bridge is attached to a physical function of a NIC that supports virtual functions using SR-IOV, MAC addresses for guests on the linux bridge are not automatically added to the forwarding database of the physical function's interface.

This hookscript can be attached to a VM using the following command:

qm set <vmid> --hookscript local:snippets/bridgefix.sh

or a container:

pct set <vmid> --hookscript local:snippets/bridgefix.sh

This will invoke a hookscript placed in the default snippet location of: /var/lib/vz/snippets/

Installation

sudo wget -O /var/lib/vz/snippets/bridgefix.sh https://raw.githubusercontent.com/jdlayman/pve-hookscript-sriov/master/bridgefix.sh

sudo chmod 755 /var/lib/vz/snippets/bridgefix.sh

Implementation

  1. The script searches the LXC/VM <vmid>.conf within /etc/pve to find the MAC address of all configured interfaces of the guest attached to a bridge.
  2. For each discovered bridge, the script looks for all interfaces connected to the bridge (linked within /sys/class/net/<bridge>/brif/.
  3. If the interface is a bond, individual slave interfaces are determined by inspecting /sys/class/net/<bond>/bonding.
  4. For each interface identified in steps #2 and #3, if the interface is a physical interface that also has virtual functions (as determined by the existence of links named /sys/class/net/<intf>/device/virtfn#), the MAC address of the guest is added to the forwarding database for the interface using the following command: bridge fdb add <mac-addr> dev <intf>.

References

About

Hookscript to add the mac address of containers to

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages