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 675D96220B for ; Fri, 11 Feb 2022 10:34:16 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 43A5026729 for ; Fri, 11 Feb 2022 10:33:46 +0100 (CET) Received: from bastionodiso.odiso.net (bastionodiso.odiso.net [185.151.191.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id C907A2663F 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 274D8404BD; Fri, 11 Feb 2022 10:33:34 +0100 (CET) Received: by kvmformation3.odiso.net (Postfix, from userid 0) id 069D91294E7; 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:24 +0100 Message-Id: <20220211093331.609127-4-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.149 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 03/10] controllers: bgp: add bgp-multipath-as-path-relax option 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:16 -0000 Some users need it to do ecmp when peering with 2 differents asn Signed-off-by: Alexandre Derumier --- PVE/Network/SDN/Controllers/BgpPlugin.pm | 9 ++++ .../expected_controller_config | 43 ++++++++++++++++ .../multipath_relax/expected_sdn_interfaces | 41 ++++++++++++++++ test/zones/evpn/multipath_relax/interfaces | 7 +++ test/zones/evpn/multipath_relax/sdn_config | 49 +++++++++++++++++++ 5 files changed, 149 insertions(+) create mode 100644 test/zones/evpn/multipath_relax/expected_controller_config create mode 100644 test/zones/evpn/multipath_relax/expected_sdn_interfaces create mode 100644 test/zones/evpn/multipath_relax/interfaces create mode 100644 test/zones/evpn/multipath_relax/sdn_config diff --git a/PVE/Network/SDN/Controllers/BgpPlugin.pm b/PVE/Network/SDN/Controllers/BgpPlugin.pm index 075ca90..1e4e708 100644 --- a/PVE/Network/SDN/Controllers/BgpPlugin.pm +++ b/PVE/Network/SDN/Controllers/BgpPlugin.pm @@ -19,6 +19,10 @@ sub type { sub properties { return { + 'bgp-multipath-as-path-relax' => { + type => 'boolean', + optional => 1, + }, ebgp => { type => 'boolean', optional => 1, @@ -41,6 +45,7 @@ sub options { 'node' => { optional => 0 }, 'asn' => { optional => 0 }, 'peers' => { optional => 0 }, + 'bgp-multipath-as-path-relax' => { optional => 1 }, 'ebgp' => { optional => 1 }, 'ebgp-multihop' => { optional => 1 }, 'loopback' => { optional => 1 }, @@ -58,6 +63,8 @@ sub generate_controller_config { my $ebgp = $plugin_config->{ebgp}; my $ebgp_multihop = $plugin_config->{'ebgp-multihop'}; my $loopback = $plugin_config->{loopback}; + my $multipath_relax = $plugin_config->{'bgp-multipath-as-path-relax'}; + my $local_node = PVE::INotify::nodename(); @@ -86,6 +93,8 @@ sub generate_controller_config { push @controller_config, "bgp disable-ebgp-connected-route-check" if $loopback; } + push @controller_config, "bgp bestpath as-path multipath-relax" if $multipath_relax; + #BGP neighbors if(@peers) { push @controller_config, "neighbor BGP peer-group"; diff --git a/test/zones/evpn/multipath_relax/expected_controller_config b/test/zones/evpn/multipath_relax/expected_controller_config new file mode 100644 index 0000000..38cc836 --- /dev/null +++ b/test/zones/evpn/multipath_relax/expected_controller_config @@ -0,0 +1,43 @@ +log syslog informational +ip forwarding +ipv6 forwarding +frr defaults datacenter +service integrated-vtysh-config +hostname localhost +! +! +vrf vrf_myzone + vni 1000 +exit-vrf +! +router bgp 65000 + bgp router-id 192.168.0.1 + no bgp default ipv4-unicast + coalesce-time 1000 + neighbor VTEP peer-group + neighbor VTEP remote-as 65000 + neighbor VTEP bfd + neighbor 192.168.0.2 peer-group VTEP + neighbor 192.168.0.3 peer-group VTEP + bgp bestpath as-path multipath-relax + neighbor BGP peer-group + neighbor BGP remote-as 65000 + neighbor BGP bfd + neighbor 192.168.0.1 peer-group BGP + neighbor 192.168.0.2 peer-group BGP + neighbor 192.168.0.3 peer-group BGP + ! + address-family ipv4 unicast + neighbor BGP activate + neighbor BGP soft-reconfiguration inbound + exit-address-family + ! + address-family l2vpn evpn + neighbor VTEP activate + advertise-all-vni + exit-address-family +! +router bgp 65000 vrf vrf_myzone +! +line vty +! \ No newline at end of file diff --git a/test/zones/evpn/multipath_relax/expected_sdn_interfaces b/test/zones/evpn/multipath_relax/expected_sdn_interfaces new file mode 100644 index 0000000..4cf13e0 --- /dev/null +++ b/test/zones/evpn/multipath_relax/expected_sdn_interfaces @@ -0,0 +1,41 @@ +#version:1 + +auto myvnet +iface myvnet + address 10.0.0.1/24 + bridge_ports vxlan_myvnet + bridge_stp off + bridge_fd 0 + mtu 1450 + ip-forward on + arp-accept on + vrf vrf_myzone + +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 + bridge-ports vrfvx_myzone + bridge_stp off + bridge_fd 0 + mtu 1450 + vrf vrf_myzone + +auto vrfvx_myzone +iface vrfvx_myzone + vxlan-id 1000 + vxlan-local-tunnelip 192.168.0.1 + bridge-learning off + bridge-arp-nd-suppress on + mtu 1450 + +auto vxlan_myvnet +iface vxlan_myvnet + vxlan-id 100 + vxlan-local-tunnelip 192.168.0.1 + bridge-learning off + bridge-arp-nd-suppress on + mtu 1450 diff --git a/test/zones/evpn/multipath_relax/interfaces b/test/zones/evpn/multipath_relax/interfaces new file mode 100644 index 0000000..66bb826 --- /dev/null +++ b/test/zones/evpn/multipath_relax/interfaces @@ -0,0 +1,7 @@ +auto vmbr0 +iface vmbr0 inet static + address 192.168.0.1/24 + gateway 192.168.0.254 + bridge-ports eth0 + bridge-stp off + bridge-fd 0 diff --git a/test/zones/evpn/multipath_relax/sdn_config b/test/zones/evpn/multipath_relax/sdn_config new file mode 100644 index 0000000..5a1d8a7 --- /dev/null +++ b/test/zones/evpn/multipath_relax/sdn_config @@ -0,0 +1,49 @@ +{ + version => 1, + vnets => { + ids => { + myvnet => { + tag => "100", + type => "vnet", + zone => "myzone", + }, + }, + }, + + zones => { + ids => { + myzone => { + ipam => "pve", + type => "evpn", + controller => "evpnctl", + 'vrf-vxlan' => 1000, + }, + }, + }, + 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.1,192.168.0.2,192.168.0.3', + 'bgp-multipath-as-path-relax' => "1", + asn => "65000", + node => "localhost", + }, + }, + }, + + subnets => { + ids => { + 'myzone-10.0.0.0-24' => { + 'type' => 'subnet', + 'vnet' => 'myvnet', + 'gateway' => '10.0.0.1', + }, + }, + }, +} -- 2.30.2