From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 80F2B1FF13F for ; Thu, 12 Mar 2026 11:20:56 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D6842E62E; Thu, 12 Mar 2026 11:20:51 +0100 (CET) Date: Thu, 12 Mar 2026 11:20:17 +0100 From: Gabriel Goller To: Hannes Laimer Subject: Re: [PATCH pve-network v5 4/9] sdn: write structured frr config that can be rendered using templates Message-ID: Mail-Followup-To: Hannes Laimer , pve-devel@lists.proxmox.com References: <20260310120705.150425-1-g.goller@proxmox.com> <20260310120705.150425-14-g.goller@proxmox.com> <234387df-69aa-4b37-8a72-b13affd7404e@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <234387df-69aa-4b37-8a72-b13affd7404e@proxmox.com> User-Agent: NeoMutt/20241002-35-39f9a6 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773310782070 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.020 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_MSPIKE_H2 0.001 Average reputation (+2) 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: MJVAIVYPSIATJPJUBUDQUAKHDYQTL2MC X-Message-ID-Hash: MJVAIVYPSIATJPJUBUDQUAKHDYQTL2MC X-MailFrom: g.goller@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 CC: pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 12.03.2026 10:20, Hannes Laimer wrote: > On 2026-03-10 13:09, Gabriel Goller wrote: > > The structured frr config can be deserialized by rust and rendered using > > the templates (isis and bgp) in proxmox-frr. > > > > Co-authored-by: Stefan Hanreich > > Signed-off-by: Gabriel Goller > > --- > > [..] > > > diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm > > index cc217126607f..e3091c63ac8d 100644 > > --- a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm > > +++ b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm [snip] > > @@ -102,10 +102,10 @@ sub generate_frr_config { > > } elsif ($plugin_config->{'peers'}) { > > @peers = PVE::Tools::split_list($plugin_config->{'peers'}); > > > > - if ($bgprouter) { > > - $loopback = $bgprouter->{loopback} if $bgprouter->{loopback}; > > - } elsif ($isisrouter) { > > - $loopback = $isisrouter->{loopback} if $isisrouter->{loopback}; > > + if ($bgp_controller) { > > + $loopback = $bgp_controller->{loopback} if $bgp_controller->{loopback}; > > + } elsif ($isis_controller) { > > + $loopback = $isis_controller->{loopback} if $isis_controller->{loopback}; > > } > > > > ($ifaceip, my $interface) = > > @@ -116,58 +116,60 @@ sub generate_frr_config { > > return; > > } > > > > - if ($bgprouter) { > > - $ebgp = 1 if $plugin_config->{'asn'} ne $bgprouter->{asn}; > > - $asn = $bgprouter->{asn} if $bgprouter->{asn}; > > + if ($bgp_controller) { > > + $ebgp = 1 if $plugin_config->{'asn'} ne $bgp_controller->{asn}; > > + $asn = $bgp_controller->{asn} if $bgp_controller->{asn}; > > missing `int(..)`, so the var is flagged correctly Ack, thanks for the review! > > $autortas = $plugin_config->{'asn'} if $ebgp; > > } > > > > return if !$asn || !$routerid; > > - my $bgp = $config->{frr}->{router}->{"bgp $asn"} //= {}; > > - > > - my $remoteas = $ebgp ? "external" : $asn; > > - > > - #global options > > - my @controller_config = ( > > - "bgp router-id $routerid", > > - "no bgp hard-administrative-reset", > > - "no bgp default ipv4-unicast", > > - "coalesce-time 1000", > > - "no bgp graceful-restart notification", > > - ); > > - > > - push(@{ $bgp->{""} }, @controller_config) if keys %{$bgp} == 0; > > > > [..]