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 7314B7570E for ; Wed, 21 Apr 2021 23:49:31 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4AB3614415 for ; Wed, 21 Apr 2021 23:49:31 +0200 (CEST) Received: from kvmformation3.odiso.net (globalOdiso.M6Lille.odiso.net [89.248.211.242]) by firstgate.proxmox.com (Proxmox) with ESMTP id 94D791410A for ; Wed, 21 Apr 2021 23:49:27 +0200 (CEST) Received: by kvmformation3.odiso.net (Postfix, from userid 0) id 544838D62A; Wed, 21 Apr 2021 23:49:27 +0200 (CEST) From: Alexandre Derumier To: pve-devel@lists.proxmox.com Date: Wed, 21 Apr 2021 23:49:22 +0200 Message-Id: <20210421214926.1789330-3-aderumier@odiso.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210421214926.1789330-1-aderumier@odiso.com> References: <20210421214926.1789330-1-aderumier@odiso.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 AWL -0.169 Adjusted score from AWL reputation of From: address 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.379 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [bgpplugin.pm] Subject: [pve-devel] [PATCH v3 pve-network 2/6] bgp: add ebgp_multihop option 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, 21 Apr 2021 21:49:31 -0000 Signed-off-by: Alexandre Derumier --- PVE/Network/SDN/Controllers/BgpPlugin.pm | 7 +++++++ test/zones/evpn/ebgp/expected_controller_config | 1 + test/zones/evpn/ebgp/sdn_config | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/PVE/Network/SDN/Controllers/BgpPlugin.pm b/PVE/Network/SDN/Controllers/BgpPlugin.pm index e5d8490..69c688b 100644 --- a/PVE/Network/SDN/Controllers/BgpPlugin.pm +++ b/PVE/Network/SDN/Controllers/BgpPlugin.pm @@ -24,6 +24,10 @@ sub properties { optional => 1, description => "Enable ebgp. (remote-as external)", }, + 'ebgp-multihop' => { + type => 'integer', + optional => 1, + }, loopback => { description => "source loopback interface.", type => 'string' @@ -38,6 +42,7 @@ sub options { 'asn' => { optional => 0 }, 'peers' => { optional => 0 }, 'ebgp' => { optional => 1 }, + 'ebgp-multihop' => { optional => 1 }, 'loopback' => { optional => 1 }, }; } @@ -51,6 +56,7 @@ sub generate_controller_config { my $asn = $plugin_config->{asn}; my $ebgp = $plugin_config->{ebgp}; + my $ebgp_multihop = $plugin_config->{'ebgp-multihop'}; my $loopback = $plugin_config->{loopback}; my $local_node = PVE::INotify::nodename(); @@ -85,6 +91,7 @@ sub generate_controller_config { push @controller_config, "neighbor BGP peer-group"; push @controller_config, "neighbor BGP remote-as $remoteas"; push @controller_config, "neighbor BGP bfd"; + push @controller_config, "neighbor BGP ebgp-multihop $ebgp_multihop" if $ebgp && $ebgp_multihop; } # BGP peers diff --git a/test/zones/evpn/ebgp/expected_controller_config b/test/zones/evpn/ebgp/expected_controller_config index 4c42012..be3e1af 100644 --- a/test/zones/evpn/ebgp/expected_controller_config +++ b/test/zones/evpn/ebgp/expected_controller_config @@ -23,6 +23,7 @@ router bgp 65001 neighbor BGP peer-group neighbor BGP remote-as external neighbor BGP bfd + neighbor BGP ebgp-multihop 3 neighbor 192.168.0.252 peer-group BGP neighbor 192.168.0.253 peer-group BGP ! diff --git a/test/zones/evpn/ebgp/sdn_config b/test/zones/evpn/ebgp/sdn_config index 379dc14..91c1b61 100644 --- a/test/zones/evpn/ebgp/sdn_config +++ b/test/zones/evpn/ebgp/sdn_config @@ -12,7 +12,7 @@ controllers => { ids => { evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" }, - localhost => { type => "bgp", 'peers' => '192.168.0.252,192.168.0.253', ebgp => "1", asn => "65001", node => "localhost" }, + localhost => { type => "bgp", 'peers' => '192.168.0.252,192.168.0.253', ebgp => "1", 'ebgp-multihop' => '3', asn => "65001", node => "localhost" }, }, }, -- 2.20.1