]> git.proxmox.com Git - pve-network.git/commitdiff
bgp: add ebgp_multihop option
authorAlexandre Derumier <aderumier@odiso.com>
Wed, 21 Apr 2021 21:49:22 +0000 (23:49 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Apr 2021 08:05:52 +0000 (10:05 +0200)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/Network/SDN/Controllers/BgpPlugin.pm
test/zones/evpn/ebgp/expected_controller_config
test/zones/evpn/ebgp/sdn_config

index e5d849021c98e1fc8e6996a8a532a9618b450c5b..69c688be2c45b1f2c0a0f036288b242a4ea9ac88 100644 (file)
@@ -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
index 4c42012558295dbe85bf30c6fc08b90791802875..be3e1af61e1c97ce320a3e6573af0f8f901d3c23 100644 (file)
@@ -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
  !
index 379dc14472509589003ed5bbff074f10fb41d265..91c1b613f889a29b3583788d05d2aaf6ec0a0ed4 100644 (file)
@@ -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" },
                      },
              },