public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Alexandre Derumier <aderumier@odiso.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v2 pve-network 2/5] bgp: add ebgp_multihop option
Date: Wed, 21 Apr 2021 22:55:46 +0200	[thread overview]
Message-ID: <20210421205549.1604429-3-aderumier@odiso.com> (raw)
In-Reply-To: <20210421205549.1604429-1-aderumier@odiso.com>

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
 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




  parent reply	other threads:[~2021-04-21 20:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21 20:55 [pve-devel] [PATCH v2 pve-network 0/5] evpn && bgp improvements Alexandre Derumier
2021-04-21 20:55 ` [pve-devel] [PATCH v2 pve-network 1/5] tests: fix evpn vrf Alexandre Derumier
2021-04-21 20:55 ` Alexandre Derumier [this message]
2021-04-21 20:55 ` [pve-devel] [PATCH v2 pve-network 3/5] zones: evpn: move vnet mac option to evpn zone plugin Alexandre Derumier
2021-04-21 20:55 ` [pve-devel] [PATCH v2 pve-network 4/5] zones: evpn: fix arp-accept && ip-forward + ipv6 snat Alexandre Derumier
2021-04-21 20:55 ` [pve-devel] [PATCH v2 pve-network 5/5] zones: simple: fix ip-forward && " Alexandre Derumier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210421205549.1604429-3-aderumier@odiso.com \
    --to=aderumier@odiso.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal