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 B226C6E3C8 for ; Mon, 23 Aug 2021 15:23:02 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A974D2434C for ; Mon, 23 Aug 2021 15:22:32 +0200 (CEST) Received: from kvmformation3.odiso.net (globalOdiso.M6Lille.odiso.net [89.248.211.242]) by firstgate.proxmox.com (Proxmox) with ESMTP id 394E22431B for ; Mon, 23 Aug 2021 15:22:27 +0200 (CEST) Received: by kvmformation3.odiso.net (Postfix, from userid 0) id F0484113CF0; Mon, 23 Aug 2021 15:22:19 +0200 (CEST) From: Alexandre Derumier To: pve-devel@lists.proxmox.com Date: Mon, 23 Aug 2021 15:22:14 +0200 Message-Id: <20210823132218.3558949-2-aderumier@odiso.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210823132218.3558949-1-aderumier@odiso.com> References: <20210823132218.3558949-1-aderumier@odiso.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.891 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 KHOP_HELO_FCRDNS 0.399 Relay HELO differs from its IP's reverse DNS 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 Subject: [pve-devel] [PATCH pve-network 1/5] evpn : add "ip route del vrf vrf_myzone unreachable default metric 4278198272" on exit node 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: Mon, 23 Aug 2021 13:23:02 -0000 This is breaking routing between the evpn vrf && default vrf leak on exit node only Signed-off-by: Alexandre Derumier --- PVE/Network/SDN/Zones/EvpnPlugin.pm | 10 +++++++--- test/zones/evpn/exitnode/expected_sdn_interfaces | 2 +- test/zones/evpn/exitnode_snat/expected_sdn_interfaces | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/PVE/Network/SDN/Zones/EvpnPlugin.pm b/PVE/Network/SDN/Zones/EvpnPlugin.pm index 4fa46f7..36edccd 100644 --- a/PVE/Network/SDN/Zones/EvpnPlugin.pm +++ b/PVE/Network/SDN/Zones/EvpnPlugin.pm @@ -73,6 +73,7 @@ sub generate_sdn_config { my $bgprouter = PVE::Network::SDN::Controllers::EvpnPlugin::find_bgp_controller($local_node, $controller_cfg); my $loopback = $bgprouter->{loopback} if $bgprouter->{loopback}; my ($ifaceip, $iface) = PVE::Network::SDN::Zones::Plugin::find_local_ip_interface_peers(\@peers, $loopback); + my $is_evpn_gateway = $plugin_config->{'exitnodes'}->{$local_node}; my $mtu = 1450; $mtu = $interfaces_config->{$iface}->{mtu} - 50 if $interfaces_config->{$iface}->{mtu}; @@ -127,8 +128,6 @@ sub generate_sdn_config { if ($subnet->{snat}) { - my $is_evpn_gateway = $plugin_config->{'exitnodes'}->{$local_node}; - #find outgoing interface my ($outip, $outiface) = PVE::Network::SDN::Zones::Plugin::get_local_route_ip($checkrouteip); if ($outip && $outiface && $is_evpn_gateway) { @@ -158,7 +157,12 @@ sub generate_sdn_config { #vrf interface @iface_config = (); push @iface_config, "vrf-table auto"; - push @iface_config, "post-up ip route add vrf $vrf_iface unreachable default metric 4278198272"; + if(!$is_evpn_gateway) { + push @iface_config, "post-up ip route add vrf $vrf_iface unreachable default metric 4278198272"; + } else { + push @iface_config, "post-up ip route del vrf $vrf_iface unreachable default metric 4278198272"; + } + push(@{$config->{$vrf_iface}}, @iface_config) if !$config->{$vrf_iface}; if ($vrfvxlan) { diff --git a/test/zones/evpn/exitnode/expected_sdn_interfaces b/test/zones/evpn/exitnode/expected_sdn_interfaces index 4cf13e0..5ab3084 100644 --- a/test/zones/evpn/exitnode/expected_sdn_interfaces +++ b/test/zones/evpn/exitnode/expected_sdn_interfaces @@ -14,7 +14,7 @@ iface myvnet auto vrf_myzone iface vrf_myzone vrf-table auto - post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 + post-up ip route del vrf vrf_myzone unreachable default metric 4278198272 auto vrfbr_myzone iface vrfbr_myzone diff --git a/test/zones/evpn/exitnode_snat/expected_sdn_interfaces b/test/zones/evpn/exitnode_snat/expected_sdn_interfaces index a2a183e..47df77a 100644 --- a/test/zones/evpn/exitnode_snat/expected_sdn_interfaces +++ b/test/zones/evpn/exitnode_snat/expected_sdn_interfaces @@ -33,7 +33,7 @@ iface myvnet2 auto vrf_myzone iface vrf_myzone vrf-table auto - post-up ip route add vrf vrf_myzone unreachable default metric 4278198272 + post-up ip route del vrf vrf_myzone unreachable default metric 4278198272 auto vrfbr_myzone iface vrfbr_myzone -- 2.30.2