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 DE1C89921E for ; Thu, 20 Apr 2023 23:36:33 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BAE6C2F838 for ; Thu, 20 Apr 2023 23:36:33 +0200 (CEST) Received: from bastionodiso.odiso.net (bastionodiso.odiso.net [185.151.191.93]) (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 ; Thu, 20 Apr 2023 23:36:32 +0200 (CEST) Received: from kvmformation3.odiso.net (formationkvm3.odiso.net [10.3.94.12]) by bastionodiso.odiso.net (Postfix) with ESMTP id E81B28178; Thu, 20 Apr 2023 23:36:25 +0200 (CEST) Received: by kvmformation3.odiso.net (Postfix, from userid 0) id D4E3DD1730; Thu, 20 Apr 2023 23:36:25 +0200 (CEST) From: Alexandre Derumier To: pve-devel@lists.proxmox.com Date: Thu, 20 Apr 2023 23:36:17 +0200 Message-Id: <20230420213622.685809-2-aderumier@odiso.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230420213622.685809-1-aderumier@odiso.com> References: <20230420213622.685809-1-aderumier@odiso.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.015 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy 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 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 T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [evpnplugin.pm] Subject: [pve-devel] [PATCH pve-network 1/6] fix #4657 : evpn: fix exit-node with multiple vrf 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: Thu, 20 Apr 2023 21:36:33 -0000 Currently, if a node is primary exit-node for 1 vrf, and secondary exit-node for another vrf, the deny route-map is filtering routes imports for both vrf. This patch add filtering only for vrf where the node is secondary. Signed-off-by: Alexandre Derumier --- PVE/Network/SDN/Controllers/EvpnPlugin.pm | 1 + test/zones/evpn/exitnode/expected_controller_config | 1 + .../zones/evpn/exitnode_local_routing/expected_controller_config | 1 + test/zones/evpn/exitnode_snat/expected_controller_config | 1 + 4 files changed, 4 insertions(+) diff --git a/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/PVE/Network/SDN/Controllers/EvpnPlugin.pm index 727aeaa..9d39b9b 100644 --- a/PVE/Network/SDN/Controllers/EvpnPlugin.pm +++ b/PVE/Network/SDN/Controllers/EvpnPlugin.pm @@ -168,6 +168,7 @@ sub generate_controller_zone_config { if (!$exitnodes_primary || $exitnodes_primary eq $local_node) { #filter default type5 route coming from other exit nodes on primary node or both nodes if no primary is defined. my $routemap_config = (); + push @{$routemap_config}, "match evpn vni $vrfvxlan"; push @{$routemap_config}, "match evpn route-type prefix"; my $routemap = { rule => $routemap_config, action => "deny" }; unshift(@{$config->{frr_routemap}->{'MAP_VTEP_IN'}}, $routemap); diff --git a/test/zones/evpn/exitnode/expected_controller_config b/test/zones/evpn/exitnode/expected_controller_config index 48830a3..2c3f19e 100644 --- a/test/zones/evpn/exitnode/expected_controller_config +++ b/test/zones/evpn/exitnode/expected_controller_config @@ -53,6 +53,7 @@ router bgp 65000 vrf vrf_myzone exit ! route-map MAP_VTEP_IN deny 1 + match evpn vni 1000 match evpn route-type prefix exit ! diff --git a/test/zones/evpn/exitnode_local_routing/expected_controller_config b/test/zones/evpn/exitnode_local_routing/expected_controller_config index f671b63..c557a7e 100644 --- a/test/zones/evpn/exitnode_local_routing/expected_controller_config +++ b/test/zones/evpn/exitnode_local_routing/expected_controller_config @@ -38,6 +38,7 @@ router bgp 65000 vrf vrf_myzone exit ! route-map MAP_VTEP_IN deny 1 + match evpn vni 1000 match evpn route-type prefix exit ! diff --git a/test/zones/evpn/exitnode_snat/expected_controller_config b/test/zones/evpn/exitnode_snat/expected_controller_config index 48830a3..2c3f19e 100644 --- a/test/zones/evpn/exitnode_snat/expected_controller_config +++ b/test/zones/evpn/exitnode_snat/expected_controller_config @@ -53,6 +53,7 @@ router bgp 65000 vrf vrf_myzone exit ! route-map MAP_VTEP_IN deny 1 + match evpn vni 1000 match evpn route-type prefix exit ! -- 2.30.2