* [pve-devel] [PATCH pve-network 1/2] tests: fix evpn vrf
2021-04-10 10:33 [pve-devel] [PATCH pve-network 0/2] evpn && bgp improvements Alexandre Derumier
@ 2021-04-10 10:33 ` Alexandre Derumier
2021-04-10 10:33 ` [pve-devel] [PATCH pve-network 2/2] bgp: add ebgp_multihop option Alexandre Derumier
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Derumier @ 2021-04-10 10:33 UTC (permalink / raw)
To: pve-devel
---
test/zones/evpn/ebgp/expected_sdn_interfaces | 1 +
test/zones/evpn/ebgp_loopback/expected_sdn_interfaces | 1 +
test/zones/evpn/exitnode/expected_sdn_interfaces | 1 +
test/zones/evpn/exitnode_snat/expected_sdn_interfaces | 1 +
test/zones/evpn/ipv4/expected_sdn_interfaces | 1 +
5 files changed, 5 insertions(+)
diff --git a/test/zones/evpn/ebgp/expected_sdn_interfaces b/test/zones/evpn/ebgp/expected_sdn_interfaces
index 799dcb7..6d2d3b6 100644
--- a/test/zones/evpn/ebgp/expected_sdn_interfaces
+++ b/test/zones/evpn/ebgp/expected_sdn_interfaces
@@ -12,6 +12,7 @@ iface myvnet
auto vrf_myzone
iface vrf_myzone
vrf-table auto
+ post-up ip route add vrf vrf_myzone unreachable default metric 4278198272
auto vrfbr_myzone
iface vrfbr_myzone
diff --git a/test/zones/evpn/ebgp_loopback/expected_sdn_interfaces b/test/zones/evpn/ebgp_loopback/expected_sdn_interfaces
index 799dcb7..6d2d3b6 100644
--- a/test/zones/evpn/ebgp_loopback/expected_sdn_interfaces
+++ b/test/zones/evpn/ebgp_loopback/expected_sdn_interfaces
@@ -12,6 +12,7 @@ iface myvnet
auto vrf_myzone
iface vrf_myzone
vrf-table auto
+ post-up ip route add vrf vrf_myzone unreachable default metric 4278198272
auto vrfbr_myzone
iface vrfbr_myzone
diff --git a/test/zones/evpn/exitnode/expected_sdn_interfaces b/test/zones/evpn/exitnode/expected_sdn_interfaces
index 799dcb7..6d2d3b6 100644
--- a/test/zones/evpn/exitnode/expected_sdn_interfaces
+++ b/test/zones/evpn/exitnode/expected_sdn_interfaces
@@ -12,6 +12,7 @@ iface myvnet
auto vrf_myzone
iface vrf_myzone
vrf-table auto
+ post-up ip route add vrf vrf_myzone unreachable default metric 4278198272
auto vrfbr_myzone
iface vrfbr_myzone
diff --git a/test/zones/evpn/exitnode_snat/expected_sdn_interfaces b/test/zones/evpn/exitnode_snat/expected_sdn_interfaces
index b364a58..e8093a2 100644
--- a/test/zones/evpn/exitnode_snat/expected_sdn_interfaces
+++ b/test/zones/evpn/exitnode_snat/expected_sdn_interfaces
@@ -16,6 +16,7 @@ iface myvnet
auto vrf_myzone
iface vrf_myzone
vrf-table auto
+ post-up ip route add vrf vrf_myzone unreachable default metric 4278198272
auto vrfbr_myzone
iface vrfbr_myzone
diff --git a/test/zones/evpn/ipv4/expected_sdn_interfaces b/test/zones/evpn/ipv4/expected_sdn_interfaces
index 799dcb7..6d2d3b6 100644
--- a/test/zones/evpn/ipv4/expected_sdn_interfaces
+++ b/test/zones/evpn/ipv4/expected_sdn_interfaces
@@ -12,6 +12,7 @@ iface myvnet
auto vrf_myzone
iface vrf_myzone
vrf-table auto
+ post-up ip route add vrf vrf_myzone unreachable default metric 4278198272
auto vrfbr_myzone
iface vrfbr_myzone
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [pve-devel] [PATCH pve-network 2/2] bgp: add ebgp_multihop option
2021-04-10 10:33 [pve-devel] [PATCH pve-network 0/2] evpn && bgp improvements Alexandre Derumier
2021-04-10 10:33 ` [pve-devel] [PATCH pve-network 1/2] tests: fix evpn vrf Alexandre Derumier
@ 2021-04-10 10:33 ` Alexandre Derumier
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Derumier @ 2021-04-10 10:33 UTC (permalink / raw)
To: pve-devel
---
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
^ permalink raw reply [flat|nested] 3+ messages in thread