From: Alexandre Derumier <aderumier@odiso.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-network 06/10] controllers: evpn: add missing bgp router-id in vrf
Date: Fri, 11 Feb 2022 10:33:27 +0100 [thread overview]
Message-ID: <20220211093331.609127-7-aderumier@odiso.com> (raw)
In-Reply-To: <20220211093331.609127-1-aderumier@odiso.com>
evpn route distinguisher is compute from bgp router-id.
if not defined, it take random ip or 0.0.0.0 and could result collisions between hosts
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
---
PVE/Network/SDN/Controllers/EvpnPlugin.pm | 4 ++++
test/zones/evpn/advertise_subnets/expected_controller_config | 1 +
.../disable_arp_nd_suppression/expected_controller_config | 1 +
test/zones/evpn/ebgp/expected_controller_config | 1 +
test/zones/evpn/ebgp_loopback/expected_controller_config | 1 +
test/zones/evpn/exitnode/expected_controller_config | 1 +
.../evpn/exitnode_local_routing/expected_controller_config | 1 +
test/zones/evpn/exitnode_snat/expected_controller_config | 1 +
test/zones/evpn/ipv4/expected_controller_config | 1 +
test/zones/evpn/ipv4ipv6/expected_controller_config | 1 +
test/zones/evpn/ipv4ipv6nogateway/expected_controller_config | 1 +
test/zones/evpn/ipv6/expected_controller_config | 1 +
test/zones/evpn/multipath_relax/expected_controller_config | 1 +
13 files changed, 16 insertions(+)
diff --git a/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
index 2b48e9a..96abb9f 100644
--- a/PVE/Network/SDN/Controllers/EvpnPlugin.pm
+++ b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
@@ -123,6 +123,7 @@ sub generate_controller_zone_config {
my $exitnodes_local_routing = $plugin_config->{'exitnodes-local-routing'};
my $asn = $controller->{asn};
+ my @peers = PVE::Tools::split_list($controller->{'peers'}) if $controller->{'peers'};
my $ebgp = undef;
my $loopback = undef;
my $autortas = undef;
@@ -136,6 +137,8 @@ sub generate_controller_zone_config {
return if !$vrf || !$vrfvxlan || !$asn;
+ my ($ifaceip, $interface) = PVE::Network::SDN::Zones::Plugin::find_local_ip_interface_peers(\@peers, $loopback);
+
# vrf
my @controller_config = ();
push @controller_config, "vni $vrfvxlan";
@@ -143,6 +146,7 @@ sub generate_controller_zone_config {
#main vrf router
@controller_config = ();
+ push @controller_config, "bgp router-id $ifaceip";
push @controller_config, "no bgp ebgp-requires-policy" if $ebgp;
# push @controller_config, "!";
push(@{$config->{frr}->{router}->{"bgp $asn vrf $vrf"}->{""}}, @controller_config);
diff --git a/test/zones/evpn/advertise_subnets/expected_controller_config b/test/zones/evpn/advertise_subnets/expected_controller_config
index cdaf0d4..73da849 100644
--- a/test/zones/evpn/advertise_subnets/expected_controller_config
+++ b/test/zones/evpn/advertise_subnets/expected_controller_config
@@ -27,6 +27,7 @@ router bgp 65000
exit-address-family
!
router bgp 65000 vrf vrf_myzone
+ bgp router-id 192.168.0.1
!
address-family ipv4 unicast
redistribute connected
diff --git a/test/zones/evpn/disable_arp_nd_suppression/expected_controller_config b/test/zones/evpn/disable_arp_nd_suppression/expected_controller_config
index e1d425f..4120409 100644
--- a/test/zones/evpn/disable_arp_nd_suppression/expected_controller_config
+++ b/test/zones/evpn/disable_arp_nd_suppression/expected_controller_config
@@ -27,6 +27,7 @@ router bgp 65000
exit-address-family
!
router bgp 65000 vrf vrf_myzone
+ bgp router-id 192.168.0.1
!
route-map MAP_VTEP_OUT permit 1
!
diff --git a/test/zones/evpn/ebgp/expected_controller_config b/test/zones/evpn/ebgp/expected_controller_config
index f6c8f18..ae35a35 100644
--- a/test/zones/evpn/ebgp/expected_controller_config
+++ b/test/zones/evpn/ebgp/expected_controller_config
@@ -40,6 +40,7 @@ router bgp 65001
exit-address-family
!
router bgp 65001 vrf vrf_myzone
+ bgp router-id 192.168.0.1
no bgp ebgp-requires-policy
!
address-family l2vpn evpn
diff --git a/test/zones/evpn/ebgp_loopback/expected_controller_config b/test/zones/evpn/ebgp_loopback/expected_controller_config
index 64dff4e..55141b2 100644
--- a/test/zones/evpn/ebgp_loopback/expected_controller_config
+++ b/test/zones/evpn/ebgp_loopback/expected_controller_config
@@ -45,6 +45,7 @@ router bgp 65001
exit-address-family
!
router bgp 65001 vrf vrf_myzone
+ bgp router-id 192.168.0.1
no bgp ebgp-requires-policy
!
address-family l2vpn evpn
diff --git a/test/zones/evpn/exitnode/expected_controller_config b/test/zones/evpn/exitnode/expected_controller_config
index 8a535b3..38f358b 100644
--- a/test/zones/evpn/exitnode/expected_controller_config
+++ b/test/zones/evpn/exitnode/expected_controller_config
@@ -35,6 +35,7 @@ router bgp 65000
exit-address-family
!
router bgp 65000 vrf vrf_myzone
+ bgp router-id 192.168.0.1
!
address-family ipv4 unicast
redistribute connected
diff --git a/test/zones/evpn/exitnode_local_routing/expected_controller_config b/test/zones/evpn/exitnode_local_routing/expected_controller_config
index 876da86..1968def 100644
--- a/test/zones/evpn/exitnode_local_routing/expected_controller_config
+++ b/test/zones/evpn/exitnode_local_routing/expected_controller_config
@@ -28,6 +28,7 @@ router bgp 65000
exit-address-family
!
router bgp 65000 vrf vrf_myzone
+ bgp router-id 192.168.0.1
!
address-family l2vpn evpn
default-originate ipv4
diff --git a/test/zones/evpn/exitnode_snat/expected_controller_config b/test/zones/evpn/exitnode_snat/expected_controller_config
index 8a535b3..38f358b 100644
--- a/test/zones/evpn/exitnode_snat/expected_controller_config
+++ b/test/zones/evpn/exitnode_snat/expected_controller_config
@@ -35,6 +35,7 @@ router bgp 65000
exit-address-family
!
router bgp 65000 vrf vrf_myzone
+ bgp router-id 192.168.0.1
!
address-family ipv4 unicast
redistribute connected
diff --git a/test/zones/evpn/ipv4/expected_controller_config b/test/zones/evpn/ipv4/expected_controller_config
index e1d425f..4120409 100644
--- a/test/zones/evpn/ipv4/expected_controller_config
+++ b/test/zones/evpn/ipv4/expected_controller_config
@@ -27,6 +27,7 @@ router bgp 65000
exit-address-family
!
router bgp 65000 vrf vrf_myzone
+ bgp router-id 192.168.0.1
!
route-map MAP_VTEP_OUT permit 1
!
diff --git a/test/zones/evpn/ipv4ipv6/expected_controller_config b/test/zones/evpn/ipv4ipv6/expected_controller_config
index e1d425f..4120409 100644
--- a/test/zones/evpn/ipv4ipv6/expected_controller_config
+++ b/test/zones/evpn/ipv4ipv6/expected_controller_config
@@ -27,6 +27,7 @@ router bgp 65000
exit-address-family
!
router bgp 65000 vrf vrf_myzone
+ bgp router-id 192.168.0.1
!
route-map MAP_VTEP_OUT permit 1
!
diff --git a/test/zones/evpn/ipv4ipv6nogateway/expected_controller_config b/test/zones/evpn/ipv4ipv6nogateway/expected_controller_config
index e1d425f..4120409 100644
--- a/test/zones/evpn/ipv4ipv6nogateway/expected_controller_config
+++ b/test/zones/evpn/ipv4ipv6nogateway/expected_controller_config
@@ -27,6 +27,7 @@ router bgp 65000
exit-address-family
!
router bgp 65000 vrf vrf_myzone
+ bgp router-id 192.168.0.1
!
route-map MAP_VTEP_OUT permit 1
!
diff --git a/test/zones/evpn/ipv6/expected_controller_config b/test/zones/evpn/ipv6/expected_controller_config
index e1d425f..4120409 100644
--- a/test/zones/evpn/ipv6/expected_controller_config
+++ b/test/zones/evpn/ipv6/expected_controller_config
@@ -27,6 +27,7 @@ router bgp 65000
exit-address-family
!
router bgp 65000 vrf vrf_myzone
+ bgp router-id 192.168.0.1
!
route-map MAP_VTEP_OUT permit 1
!
diff --git a/test/zones/evpn/multipath_relax/expected_controller_config b/test/zones/evpn/multipath_relax/expected_controller_config
index 18095ec..d7f51b1 100644
--- a/test/zones/evpn/multipath_relax/expected_controller_config
+++ b/test/zones/evpn/multipath_relax/expected_controller_config
@@ -39,6 +39,7 @@ router bgp 65000
exit-address-family
!
router bgp 65000 vrf vrf_myzone
+ bgp router-id 192.168.0.1
!
route-map MAP_VTEP_OUT permit 1
!
--
2.30.2
next prev parent reply other threads:[~2022-02-11 9:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-11 9:33 [pve-devel] [PATCH pve-network 00/10] bgp/evpn improvements Alexandre Derumier
2022-02-11 9:33 ` [pve-devel] [PATCH pve-network 01/10] zones: status : skip node if node don't have the zone Alexandre Derumier
2022-02-11 9:33 ` [pve-devel] [PATCH pve-network 02/10] controllers: bgp: use loopback ip src for loopback network Alexandre Derumier
2022-02-11 9:33 ` [pve-devel] [PATCH pve-network 03/10] controllers: bgp: add bgp-multipath-as-path-relax option Alexandre Derumier
2022-02-11 9:33 ` [pve-devel] [PATCH pve-network 04/10] controllers: evpn : add min/max value to asn Alexandre Derumier
2022-02-11 9:33 ` [pve-devel] [PATCH pve-network 05/10] controllers: evpn/bgp : add exitnodes-primary && rework route-map Alexandre Derumier
2022-02-11 9:33 ` Alexandre Derumier [this message]
2022-02-11 9:33 ` [pve-devel] [PATCH pve-network 07/10] zones: evpn : add rt-import Alexandre Derumier
2022-02-11 9:33 ` [pve-devel] [PATCH pve-network 08/10] controllers: evpn : remove "no bgp ebgp-requires-policy" Alexandre Derumier
2022-02-11 9:33 ` [pve-devel] [PATCH pve-network 09/10] controllers: bgp : remove bgp network import-check Alexandre Derumier
2022-02-11 9:33 ` [pve-devel] [PATCH pve-network 10/10] controllers: evpn : remove ip forwarding, ipv6 forwarding and add frr version Alexandre Derumier
2022-02-14 7:12 ` [pve-devel] applied-series: [PATCH pve-network 00/10] bgp/evpn improvements Thomas Lamprecht
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=20220211093331.609127-7-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.