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 8D01662219 for ; Fri, 11 Feb 2022 10:34:19 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8A0E52678A for ; Fri, 11 Feb 2022 10:33:48 +0100 (CET) Received: from bastionodiso.odiso.net (bastionodiso.odiso.net [IPv6:2a0a:1580:2000::2d]) (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 firstgate.proxmox.com (Proxmox) with ESMTPS id F11D22664D for ; Fri, 11 Feb 2022 10:33:40 +0100 (CET) Received: from kvmformation3.odiso.net (formationkvm3.odiso.net [10.3.94.12]) by bastionodiso.odiso.net (Postfix) with ESMTP id 2D51B16ACB6; Fri, 11 Feb 2022 10:33:34 +0100 (CET) Received: by kvmformation3.odiso.net (Postfix, from userid 0) id 178871295CF; Fri, 11 Feb 2022 10:33:34 +0100 (CET) From: Alexandre Derumier To: pve-devel@lists.proxmox.com Date: Fri, 11 Feb 2022 10:33:27 +0100 Message-Id: <20220211093331.609127-7-aderumier@odiso.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220211093331.609127-1-aderumier@odiso.com> References: <20220211093331.609127-1-aderumier@odiso.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.002 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% HEADER_FROM_DIFFERENT_DOMAINS 0.248 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 NO_DNS_FOR_FROM 0.001 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 T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH pve-network 06/10] controllers: evpn: add missing bgp router-id in vrf 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: Fri, 11 Feb 2022 09:34:19 -0000 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 --- 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