From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id B58271FF140 for ; Fri, 27 Mar 2026 11:44:26 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E0A4850C0; Fri, 27 Mar 2026 11:44:47 +0100 (CET) Message-ID: <04425c42-4037-4ce8-b81b-9c1eb0398373@proxmox.com> Date: Fri, 27 Mar 2026 11:44:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH pve-network 08/13] evpn controller: add route_map_{in,out} parameter To: Stefan Hanreich , pve-devel@lists.proxmox.com References: <20260325094142.174364-1-s.hanreich@proxmox.com> <20260325094142.174364-23-s.hanreich@proxmox.com> Content-Language: en-US From: Hannes Laimer In-Reply-To: <20260325094142.174364-23-s.hanreich@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1774608234201 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.080 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 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: F2USAMFCYAUJ5DVVQ6ZE22R2NRC42QWX X-Message-ID-Hash: F2USAMFCYAUJ5DVVQ6ZE22R2NRC42QWX X-MailFrom: h.laimer@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: in `generate_zone_frr_config` we probably also want to use the newly introduced `route-map-[in|out]` parameter, not the hard coded ones On 2026-03-25 10:42, Stefan Hanreich wrote: > This parameter allows overriding the default MAP_VTEP_{IN,OUT} route > maps by specifying a custom route map configured in route-maps.cfg. > This can be used for filtering incoming and outgoing routes, e.g. for > only advertising type-5 routes to external peers or only allow > importing routes with specific route targets. > > Signed-off-by: Stefan Hanreich > --- > src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 19 +++++++++++++------ > src/PVE/Network/SDN/Controllers/Plugin.pm | 14 ++++++++++++++ > 2 files changed, 27 insertions(+), 6 deletions(-) > > diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm > index 3e643b1..d7b838b 100644 > --- a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm > +++ b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm > @@ -45,6 +45,8 @@ sub options { > 'asn' => { optional => 0 }, > 'peers' => { optional => 1 }, > 'fabric' => { optional => 1 }, > + 'route-map-in' => { optional => 1 }, > + 'route-map-out' => { optional => 1 }, > }; > } > > @@ -153,23 +155,28 @@ sub generate_frr_config { > > push @{ $bgp_router->{neighbor_groups} }, $neighbor_group; > > + my $route_map_in = $plugin_config->{'route-map-in'} // 'MAP_VTEP_IN'; > + my $route_map_out = $plugin_config->{'route-map-out'} // 'MAP_VTEP_OUT'; > + > # Configure l2vpn evpn address family > $bgp_router->{address_families}->{l2vpn_evpn} //= { > neighbors => [{ > name => "VTEP", > - route_map_in => 'MAP_VTEP_IN', > - route_map_out => 'MAP_VTEP_OUT', > + route_map_in => $route_map_in, > + route_map_out => $route_map_out, > }], > advertise_all_vni => 1, > }; > > $bgp_router->{address_families}->{l2vpn_evpn}->{autort_as} = $autortas if $autortas; > > - my $routemap_in = { seq => 1, action => "permit" }; > - my $routemap_out = { seq => 1, action => "permit" }; > + if ($route_map_in eq 'MAP_VTEP_IN' && !$config->{frr}->{routemaps}->{'MAP_VTEP_IN'}) { > + push($config->{frr}->{routemaps}->{'MAP_VTEP_IN'}->@*, { seq => 1, action => "permit" }); > + } > > - push($config->{frr}->{routemaps}->{'MAP_VTEP_IN'}->@*, $routemap_in); > - push($config->{frr}->{routemaps}->{'MAP_VTEP_OUT'}->@*, $routemap_out); > + if ($route_map_out eq 'MAP_VTEP_OUT' && !$config->{frr}->{routemaps}->{'MAP_VTEP_OUT'}) { > + push($config->{frr}->{routemaps}->{'MAP_VTEP_OUT'}->@*, { seq => 1, action => "permit" }); > + } > > return $config; > } > diff --git a/src/PVE/Network/SDN/Controllers/Plugin.pm b/src/PVE/Network/SDN/Controllers/Plugin.pm > index d70e518..5f9f1ef 100644 > --- a/src/PVE/Network/SDN/Controllers/Plugin.pm > +++ b/src/PVE/Network/SDN/Controllers/Plugin.pm > @@ -7,6 +7,8 @@ use PVE::Tools; > use PVE::JSONSchema; > use PVE::Cluster; > > +use PVE::Network::SDN::RouteMaps; > + > use PVE::JSONSchema qw(get_standard_option); > use base qw(PVE::SectionConfig); > > @@ -51,6 +53,18 @@ my $defaultData = { > 'pve-sdn-controller-id', > { completion => \&PVE::Network::SDN::complete_sdn_controller }, > ), > + 'route-map-in' => { > + description => "Route Map that should be applied for incoming routes", > + type => 'string', > + format => 'pve-sdn-route-map-id', > + optional => 1, > + }, > + 'route-map-out' => { > + description => "Route Map that should be applied for outgoing routes", > + type => 'string', > + format => 'pve-sdn-route-map-id', > + optional => 1, > + }, > }, > }; >