How to enable bridge-disable-mac-learning=1 for SDN?

linum

Renowned Member
Sep 25, 2011
100
3
83
I wonder how to enable the bridge-disable-mac-learning feature within SDN?

According to the sourcecode it should belong to the bridge object but trying it like this (see below, some line from /etc/network/interfaces) doesn't work.

Code:
auto vmbr27
allow-ovs vmbr27
iface vmbr27 inet manual
  ovs_type OVSBridge
  ovs_ports eno1 vlan2700 vlan2704 vlan2711
  bridge-disable-mac-learning 1
 
I don't think so because the sourcecode contains these hits:

Code:
find /usr -type f -exec grep bridge-disable-mac-learning {} +
/usr/share/perl5/PVE/INotify.pm:                        'bridge-disable-mac-learning' => 1,
/usr/share/perl5/PVE/INotify.pm:        $done->{'bridge-disable-mac-learning'} = 1;
/usr/share/perl5/PVE/Network/SDN/Zones/Plugin.pm:    $opts->{learning} = 0 if $plugin_config->{'bridge-disable-mac-learning'};
/usr/share/perl5/PVE/Network/SDN/Zones/Plugin.pm:    PVE::Network::add_bridge_fdb($iface, $macaddr) if $plugin_config->{'bridge-disable-mac-learning'};
/usr/share/perl5/PVE/Network/SDN/Zones/Plugin.pm:    PVE::Network::del_bridge_fdb($iface, $macaddr) if $plugin_config->{'bridge-disable-mac-learning'};
/usr/share/perl5/PVE/Network/SDN/Zones/EvpnPlugin.pm:        'bridge-disable-mac-learning' => { optional => 1 },
/usr/share/perl5/PVE/Network/SDN/Zones/QinQPlugin.pm:        'bridge-disable-mac-learning' => { optional => 1 },
/usr/share/perl5/PVE/Network/SDN/Zones/VlanPlugin.pm:   'bridge-disable-mac-learning' => {
/usr/share/perl5/PVE/Network/SDN/Zones/VlanPlugin.pm:   'bridge-disable-mac-learning' => { optional => 1 },
/usr/share/perl5/PVE/Network/SDN/Zones.pm:      $opts->{learning} = 0 if $interfaces_config->{ifaces}->{$bridge} && $interfaces_config->{ifaces}->{$bridge}->{'bridge-disable-mac-learning'};
/usr/share/perl5/PVE/Network.pm:        $opts->{learning} = !($bridge && $bridge->{'bridge-disable-mac-learning'}); # default learning to on
 
Hi, It's not yet exposed to the gui,
but you just need to add "bridge-disable-mac-learning 1" in the zone, in /etc/pve/sdn/zones.cfg
Thanks for the hint!
BTW, it's not working with ovs, only linux bridge. (SDN vnets are using linux bridge)
I just figured that out by looking at the code. I hope this would be added to OVS too.