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)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 06AD593D09 for ; Tue, 11 Apr 2023 13:59:11 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D4D0F353D2 for ; Tue, 11 Apr 2023 13:58:40 +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 ; Tue, 11 Apr 2023 13:58:39 +0200 (CEST) Received: from kvmformation3.odiso.net (formationkvm3.odiso.net [10.3.94.12]) by bastionodiso.odiso.net (Postfix) with ESMTP id 6339D8172; Tue, 11 Apr 2023 13:58:33 +0200 (CEST) Received: by kvmformation3.odiso.net (Postfix, from userid 0) id 54303244C37; Tue, 11 Apr 2023 13:58:33 +0200 (CEST) From: Alexandre Derumier To: pve-devel@lists.proxmox.com Date: Tue, 11 Apr 2023 13:58:32 +0200 Message-Id: <20230411115832.1348336-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.026 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 Subject: [pve-devel] [PATCH pve-network] 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: Tue, 11 Apr 2023 11:59:11 -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