1 From 39b395b1fd41e5ac4066c5afd19b6ab9c17b8b14 Mon Sep 17 00:00:00 2001
2 From: alexandre derumier <aderumier@odiso.com>
3 Date: Thu, 1 Sep 2022 19:18:21 +0200
4 Subject: [PATCH] addons: openvswitch : add support for fakebridge.
6 Fake bridge are are ovsbridge child of a parent bridge with a specific vlan tag.
10 iface br-parent inet manual
14 iface br-fakev10 inet manual
17 ovs_options br-parent 10
21 ifupdown2/addons/openvswitch.py | 10 +++++++++-
22 1 file changed, 9 insertions(+), 1 deletion(-)
24 diff --git a/ifupdown2/addons/openvswitch.py b/ifupdown2/addons/openvswitch.py
25 index 2c9a76f7..0a124ba2 100644
26 --- a/ifupdown2/addons/openvswitch.py
27 +++ b/ifupdown2/addons/openvswitch.py
28 @@ -74,6 +74,10 @@ class openvswitch(Addon, moduleBase):
30 "example": ["ovs-ports-condone-regex ^[a-zA-Z0-9]+_v[0-9]{1,4}$"]
33 + 'help': 'Optional parent bridge for fake bridges',
39 @@ -147,13 +151,17 @@ def _addbridge (self, ifaceobj):
40 ovsextra = ifaceobj.get_attr_value('ovs-extra')
41 ovsmtu = ifaceobj.get_attr_value_first ('ovs-mtu')
42 ovsportscondoneregex = self._get_ovs_port_condone_regex(ifaceobj)
43 + ovsparent = ifaceobj.get_attr_value_first ('ovs-bridge')
47 cmd = "--may-exist add-br %s"%(iface)
48 + if ovsparent is not None and ovsoptions:
49 + cmd = cmd + " %s" %(ovsoptions)
54 + if ovsparent is None and ovsoptions:
55 cmd = "set bridge %s %s" %(iface, ovsoptions)