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 4A7788B1BE for ; Wed, 24 Aug 2022 10:57:30 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 413877C75 for ; Wed, 24 Aug 2022 10:57:00 +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 ; Wed, 24 Aug 2022 10:56:57 +0200 (CEST) Received: from kvmformation3.odiso.net (formationkvm3.odiso.net [10.3.94.12]) by bastionodiso.odiso.net (Postfix) with ESMTP id 293D59E8F; Wed, 24 Aug 2022 10:56:51 +0200 (CEST) Received: by kvmformation3.odiso.net (Postfix, from userid 0) id 1595D1E03E1; Wed, 24 Aug 2022 10:56:51 +0200 (CEST) From: Alexandre Derumier To: pve-devel@lists.proxmox.com Date: Wed, 24 Aug 2022 10:56:46 +0200 Message-Id: <20220824085646.561337-4-aderumier@odiso.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220824085646.561337-1-aderumier@odiso.com> References: <20220824085646.561337-1-aderumier@odiso.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.027 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% HEADER_FROM_DIFFERENT_DOMAINS 0.249 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 T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH pve-network 3/3] frr: config : add exit on router && routemaps. 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: Wed, 24 Aug 2022 08:57:30 -0000 added recently in last frr releases, just to be sure to no break on future releases Signed-off-by: Alexandre Derumier --- PVE/Network/SDN/Controllers/EvpnPlugin.pm | 5 +++++ test/zones/evpn/advertise_subnets/expected_controller_config | 4 ++++ .../disable_arp_nd_suppression/expected_controller_config | 4 ++++ test/zones/evpn/ebgp/expected_controller_config | 4 ++++ test/zones/evpn/ebgp_loopback/expected_controller_config | 5 +++++ test/zones/evpn/exitnode/expected_controller_config | 5 +++++ .../evpn/exitnode_local_routing/expected_controller_config | 5 +++++ test/zones/evpn/exitnode_primary/expected_controller_config | 5 +++++ test/zones/evpn/exitnode_snat/expected_controller_config | 5 +++++ test/zones/evpn/ipv4/expected_controller_config | 4 ++++ test/zones/evpn/ipv4ipv6/expected_controller_config | 4 ++++ test/zones/evpn/ipv4ipv6nogateway/expected_controller_config | 4 ++++ test/zones/evpn/ipv6/expected_controller_config | 4 ++++ test/zones/evpn/multipath_relax/expected_controller_config | 4 ++++ test/zones/evpn/rt_import/expected_controller_config | 4 ++++ 15 files changed, 66 insertions(+) diff --git a/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/PVE/Network/SDN/Controllers/EvpnPlugin.pm index 2bc10f5..857ad04 100644 --- a/PVE/Network/SDN/Controllers/EvpnPlugin.pm +++ b/PVE/Network/SDN/Controllers/EvpnPlugin.pm @@ -325,6 +325,9 @@ sub generate_frr_recurse{ $exitkeylist->{vrf} = 1; $exitkeylist->{'address-family'} = 1; + my $simple_exitkeylist = {}; + $simple_exitkeylist->{router} = 1; + # FIXME: make this generic my $paddinglevel = undef; if ($level == 1 || $level == 2) { @@ -349,6 +352,7 @@ sub generate_frr_recurse{ generate_frr_recurse($final_config, $option, $key, $level+1); push @{$final_config}, $padding."exit-$parentkey" if $parentkey && defined($exitkeylist->{$parentkey}); + push @{$final_config}, $padding."exit" if $parentkey && defined($simple_exitkeylist->{$parentkey}); } } @@ -373,6 +377,7 @@ sub generate_frr_routemap { my $rule = $seq->{rule}; push @config, map { " $_" } @$rule; push @{$final_config}, @config; + push @{$final_config}, "exit"; } } } diff --git a/test/zones/evpn/advertise_subnets/expected_controller_config b/test/zones/evpn/advertise_subnets/expected_controller_config index 1a7fea2..82b06b4 100644 --- a/test/zones/evpn/advertise_subnets/expected_controller_config +++ b/test/zones/evpn/advertise_subnets/expected_controller_config @@ -25,6 +25,7 @@ router bgp 65000 neighbor VTEP activate advertise-all-vni exit-address-family +exit ! router bgp 65000 vrf vrf_myzone bgp router-id 192.168.0.1 @@ -41,10 +42,13 @@ router bgp 65000 vrf vrf_myzone advertise ipv4 unicast advertise ipv6 unicast exit-address-family +exit ! route-map MAP_VTEP_IN permit 1 +exit ! route-map MAP_VTEP_OUT permit 1 +exit ! line vty ! \ No newline at end of file diff --git a/test/zones/evpn/disable_arp_nd_suppression/expected_controller_config b/test/zones/evpn/disable_arp_nd_suppression/expected_controller_config index 7b6caf6..bd7830a 100644 --- a/test/zones/evpn/disable_arp_nd_suppression/expected_controller_config +++ b/test/zones/evpn/disable_arp_nd_suppression/expected_controller_config @@ -25,13 +25,17 @@ router bgp 65000 neighbor VTEP activate advertise-all-vni exit-address-family +exit ! router bgp 65000 vrf vrf_myzone bgp router-id 192.168.0.1 +exit ! route-map MAP_VTEP_IN permit 1 +exit ! route-map MAP_VTEP_OUT permit 1 +exit ! line vty ! \ No newline at end of file diff --git a/test/zones/evpn/ebgp/expected_controller_config b/test/zones/evpn/ebgp/expected_controller_config index 20e7dce..ccc0b28 100644 --- a/test/zones/evpn/ebgp/expected_controller_config +++ b/test/zones/evpn/ebgp/expected_controller_config @@ -37,6 +37,7 @@ router bgp 65001 advertise-all-vni autort as 65000 exit-address-family +exit ! router bgp 65001 vrf vrf_myzone bgp router-id 192.168.0.1 @@ -45,10 +46,13 @@ router bgp 65001 vrf vrf_myzone route-target import 65000:1000 route-target export 65000:1000 exit-address-family +exit ! route-map MAP_VTEP_IN permit 1 +exit ! route-map MAP_VTEP_OUT permit 1 +exit ! line vty ! \ No newline at end of file diff --git a/test/zones/evpn/ebgp_loopback/expected_controller_config b/test/zones/evpn/ebgp_loopback/expected_controller_config index 9c53a58..64fca31 100644 --- a/test/zones/evpn/ebgp_loopback/expected_controller_config +++ b/test/zones/evpn/ebgp_loopback/expected_controller_config @@ -42,6 +42,7 @@ router bgp 65001 advertise-all-vni autort as 65000 exit-address-family +exit ! router bgp 65001 vrf vrf_myzone bgp router-id 192.168.0.1 @@ -50,14 +51,18 @@ router bgp 65001 vrf vrf_myzone route-target import 65000:1000 route-target export 65000:1000 exit-address-family +exit ! route-map MAP_VTEP_IN permit 1 +exit ! route-map MAP_VTEP_OUT permit 1 +exit ! route-map correct_src permit 1 match ip address prefix-list loopbacks_ips set src 192.168.0.1 +exit ! line vty ! \ No newline at end of file diff --git a/test/zones/evpn/exitnode/expected_controller_config b/test/zones/evpn/exitnode/expected_controller_config index 7fa9b23..48830a3 100644 --- a/test/zones/evpn/exitnode/expected_controller_config +++ b/test/zones/evpn/exitnode/expected_controller_config @@ -33,6 +33,7 @@ router bgp 65000 neighbor VTEP activate advertise-all-vni exit-address-family +exit ! router bgp 65000 vrf vrf_myzone bgp router-id 192.168.0.1 @@ -49,13 +50,17 @@ router bgp 65000 vrf vrf_myzone default-originate ipv4 default-originate ipv6 exit-address-family +exit ! route-map MAP_VTEP_IN deny 1 match evpn route-type prefix +exit ! route-map MAP_VTEP_IN permit 2 +exit ! route-map MAP_VTEP_OUT permit 1 +exit ! line vty ! \ No newline at end of file diff --git a/test/zones/evpn/exitnode_local_routing/expected_controller_config b/test/zones/evpn/exitnode_local_routing/expected_controller_config index 5ddb42b..f671b63 100644 --- a/test/zones/evpn/exitnode_local_routing/expected_controller_config +++ b/test/zones/evpn/exitnode_local_routing/expected_controller_config @@ -26,6 +26,7 @@ router bgp 65000 neighbor VTEP activate advertise-all-vni exit-address-family +exit ! router bgp 65000 vrf vrf_myzone bgp router-id 192.168.0.1 @@ -34,13 +35,17 @@ router bgp 65000 vrf vrf_myzone default-originate ipv4 default-originate ipv6 exit-address-family +exit ! route-map MAP_VTEP_IN deny 1 match evpn route-type prefix +exit ! route-map MAP_VTEP_IN permit 2 +exit ! route-map MAP_VTEP_OUT permit 1 +exit ! line vty ! \ No newline at end of file diff --git a/test/zones/evpn/exitnode_primary/expected_controller_config b/test/zones/evpn/exitnode_primary/expected_controller_config index 3155866..e45b22c 100644 --- a/test/zones/evpn/exitnode_primary/expected_controller_config +++ b/test/zones/evpn/exitnode_primary/expected_controller_config @@ -33,6 +33,7 @@ router bgp 65000 neighbor VTEP activate advertise-all-vni exit-address-family +exit ! router bgp 65000 vrf vrf_myzone bgp router-id 192.168.0.1 @@ -49,15 +50,19 @@ router bgp 65000 vrf vrf_myzone default-originate ipv4 default-originate ipv6 exit-address-family +exit ! route-map MAP_VTEP_IN permit 1 +exit ! route-map MAP_VTEP_OUT permit 1 match evpn vni 1000 match evpn route-type prefix set metric 200 +exit ! route-map MAP_VTEP_OUT permit 2 +exit ! line vty ! \ No newline at end of file diff --git a/test/zones/evpn/exitnode_snat/expected_controller_config b/test/zones/evpn/exitnode_snat/expected_controller_config index 7fa9b23..48830a3 100644 --- a/test/zones/evpn/exitnode_snat/expected_controller_config +++ b/test/zones/evpn/exitnode_snat/expected_controller_config @@ -33,6 +33,7 @@ router bgp 65000 neighbor VTEP activate advertise-all-vni exit-address-family +exit ! router bgp 65000 vrf vrf_myzone bgp router-id 192.168.0.1 @@ -49,13 +50,17 @@ router bgp 65000 vrf vrf_myzone default-originate ipv4 default-originate ipv6 exit-address-family +exit ! route-map MAP_VTEP_IN deny 1 match evpn route-type prefix +exit ! route-map MAP_VTEP_IN permit 2 +exit ! route-map MAP_VTEP_OUT permit 1 +exit ! line vty ! \ No newline at end of file diff --git a/test/zones/evpn/ipv4/expected_controller_config b/test/zones/evpn/ipv4/expected_controller_config index 7b6caf6..bd7830a 100644 --- a/test/zones/evpn/ipv4/expected_controller_config +++ b/test/zones/evpn/ipv4/expected_controller_config @@ -25,13 +25,17 @@ router bgp 65000 neighbor VTEP activate advertise-all-vni exit-address-family +exit ! router bgp 65000 vrf vrf_myzone bgp router-id 192.168.0.1 +exit ! route-map MAP_VTEP_IN permit 1 +exit ! route-map MAP_VTEP_OUT permit 1 +exit ! line vty ! \ No newline at end of file diff --git a/test/zones/evpn/ipv4ipv6/expected_controller_config b/test/zones/evpn/ipv4ipv6/expected_controller_config index 7b6caf6..bd7830a 100644 --- a/test/zones/evpn/ipv4ipv6/expected_controller_config +++ b/test/zones/evpn/ipv4ipv6/expected_controller_config @@ -25,13 +25,17 @@ router bgp 65000 neighbor VTEP activate advertise-all-vni exit-address-family +exit ! router bgp 65000 vrf vrf_myzone bgp router-id 192.168.0.1 +exit ! route-map MAP_VTEP_IN permit 1 +exit ! route-map MAP_VTEP_OUT permit 1 +exit ! line vty ! \ No newline at end of file diff --git a/test/zones/evpn/ipv4ipv6nogateway/expected_controller_config b/test/zones/evpn/ipv4ipv6nogateway/expected_controller_config index 7b6caf6..bd7830a 100644 --- a/test/zones/evpn/ipv4ipv6nogateway/expected_controller_config +++ b/test/zones/evpn/ipv4ipv6nogateway/expected_controller_config @@ -25,13 +25,17 @@ router bgp 65000 neighbor VTEP activate advertise-all-vni exit-address-family +exit ! router bgp 65000 vrf vrf_myzone bgp router-id 192.168.0.1 +exit ! route-map MAP_VTEP_IN permit 1 +exit ! route-map MAP_VTEP_OUT permit 1 +exit ! line vty ! \ No newline at end of file diff --git a/test/zones/evpn/ipv6/expected_controller_config b/test/zones/evpn/ipv6/expected_controller_config index 7b6caf6..bd7830a 100644 --- a/test/zones/evpn/ipv6/expected_controller_config +++ b/test/zones/evpn/ipv6/expected_controller_config @@ -25,13 +25,17 @@ router bgp 65000 neighbor VTEP activate advertise-all-vni exit-address-family +exit ! router bgp 65000 vrf vrf_myzone bgp router-id 192.168.0.1 +exit ! route-map MAP_VTEP_IN permit 1 +exit ! route-map MAP_VTEP_OUT permit 1 +exit ! line vty ! \ No newline at end of file diff --git a/test/zones/evpn/multipath_relax/expected_controller_config b/test/zones/evpn/multipath_relax/expected_controller_config index b2df0b5..2d1ad44 100644 --- a/test/zones/evpn/multipath_relax/expected_controller_config +++ b/test/zones/evpn/multipath_relax/expected_controller_config @@ -37,13 +37,17 @@ router bgp 65000 neighbor VTEP activate advertise-all-vni exit-address-family +exit ! router bgp 65000 vrf vrf_myzone bgp router-id 192.168.0.1 +exit ! route-map MAP_VTEP_IN permit 1 +exit ! route-map MAP_VTEP_OUT permit 1 +exit ! line vty ! \ No newline at end of file diff --git a/test/zones/evpn/rt_import/expected_controller_config b/test/zones/evpn/rt_import/expected_controller_config index 3fd6870..f4f28dd 100644 --- a/test/zones/evpn/rt_import/expected_controller_config +++ b/test/zones/evpn/rt_import/expected_controller_config @@ -25,6 +25,7 @@ router bgp 65000 neighbor VTEP activate advertise-all-vni exit-address-family +exit ! router bgp 65000 vrf vrf_myzone bgp router-id 192.168.0.1 @@ -34,10 +35,13 @@ router bgp 65000 vrf vrf_myzone route-target import 65002:1000 route-target import 65003:1000 exit-address-family +exit ! route-map MAP_VTEP_IN permit 1 +exit ! route-map MAP_VTEP_OUT permit 1 +exit ! line vty ! \ No newline at end of file -- 2.30.2