From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 43333926FB for ; Fri, 14 Oct 2022 09:22:46 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 284487472 for ; Fri, 14 Oct 2022 09:22:46 +0200 (CEST) Received: from bastionodiso.odiso.net (bastionodiso.odiso.net [IPv6:2a0a:1580:2000::2d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 14 Oct 2022 09:22:44 +0200 (CEST) Received: from kvmformation3.odiso.net (formationkvm3.odiso.net [10.3.94.12]) by bastionodiso.odiso.net (Postfix) with ESMTP id BB9E37F4D; Fri, 14 Oct 2022 09:22:37 +0200 (CEST) Received: by kvmformation3.odiso.net (Postfix, from userid 0) id A0C4D1370F5; Fri, 14 Oct 2022 09:22:37 +0200 (CEST) From: Alexandre Derumier To: pve-devel@lists.proxmox.com Date: Fri, 14 Oct 2022 09:22:35 +0200 Message-Id: <20221014072235.2902517-1-aderumier@odiso.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.019 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% HEADER_FROM_DIFFERENT_DOMAINS 0.25 From and EnvelopeFrom 2nd level mail domains are different KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods NO_DNS_FOR_FROM 0.001 Envelope sender has no MX or A DNS records SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [openvswitch.py] Subject: [pve-devel] [PATCH ifupdown2] add ovs support for fakebridge. X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2022 07:22:46 -0000 This was request by a proxmox user on ifupdown2 github issues. https://github.com/CumulusNetworks/ifupdown2/issues/245 It was possible to do it with ifupdown1, but not ifupdown2. The patch is already applied upstream https://github.com/CumulusNetworks/ifupdown2/pull/246 example to define a fake ovs bridge with vlan10: auto vmbr0 iface vmbr0 inet manual ovs_type OVSBridge auto vmbr0v10 iface vmbr0v10 inet manual ovs_type OVSBridge ovs_bridge vmbr0 ovs_options vmbr0 10 Signed-off-by: Alexandre Derumier --- debian/patches/series | 3 +- .../0001-ovs-add-support-for-fakebridge.patch | 57 +++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 debian/patches/upstream/0001-ovs-add-support-for-fakebridge.patch diff --git a/debian/patches/series b/debian/patches/series index a005387..ccfd03d 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -11,4 +11,5 @@ pve/0010-postinst-rm-update-network-config-compatibility.patch pve/0011-d-rules-drop-now-default-with-systemd.patch pve/0012-d-rules-add-dh_installsystemd-override-for-compat-12.patch pve/0013-postinst-reload-network-config-on-first-install.patch -pve/0014-fix-pointopoint-regression.patch \ No newline at end of file +pve/0014-fix-pointopoint-regression.patch +upstream/0001-ovs-add-support-for-fakebridge.patch \ No newline at end of file diff --git a/debian/patches/upstream/0001-ovs-add-support-for-fakebridge.patch b/debian/patches/upstream/0001-ovs-add-support-for-fakebridge.patch new file mode 100644 index 0000000..7e9eb67 --- /dev/null +++ b/debian/patches/upstream/0001-ovs-add-support-for-fakebridge.patch @@ -0,0 +1,57 @@ +From 39b395b1fd41e5ac4066c5afd19b6ab9c17b8b14 Mon Sep 17 00:00:00 2001 +From: alexandre derumier +Date: Thu, 1 Sep 2022 19:18:21 +0200 +Subject: [PATCH] addons: openvswitch : add support for fakebridge. + +Fake bridge are are ovsbridge child of a parent bridge with a specific vlan tag. + +``` +auto br-parent +iface br-parent inet manual + ovs_type OVSBridge + +auto br-fakev10 +iface br-fakev10 inet manual + ovs_type OVSBridge + ovs_bridge br-parent + ovs_options br-parent 10 + +``` +--- + ifupdown2/addons/openvswitch.py | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/ifupdown2/addons/openvswitch.py b/ifupdown2/addons/openvswitch.py +index 2c9a76f7..0a124ba2 100644 +--- a/ifupdown2/addons/openvswitch.py ++++ b/ifupdown2/addons/openvswitch.py +@@ -74,6 +74,10 @@ class openvswitch(Addon, moduleBase): + "required": False, + "example": ["ovs-ports-condone-regex ^[a-zA-Z0-9]+_v[0-9]{1,4}$"] + }, ++ 'ovs-bridge': { ++ 'help': 'Optional parent bridge for fake bridges', ++ 'required': False, ++ }, + } + } + +@@ -147,13 +151,17 @@ def _addbridge (self, ifaceobj): + ovsextra = ifaceobj.get_attr_value('ovs-extra') + ovsmtu = ifaceobj.get_attr_value_first ('ovs-mtu') + ovsportscondoneregex = self._get_ovs_port_condone_regex(ifaceobj) ++ ovsparent = ifaceobj.get_attr_value_first ('ovs-bridge') + + cmd_list = [] + + cmd = "--may-exist add-br %s"%(iface) ++ if ovsparent is not None and ovsoptions: ++ cmd = cmd + " %s" %(ovsoptions) ++ + cmd_list.append(cmd) + +- if ovsoptions: ++ if ovsparent is None and ovsoptions: + cmd = "set bridge %s %s" %(iface, ovsoptions) + cmd_list.append(cmd) + -- 2.30.2