[pve-devel] [PATCH pve-network] fix #4657 : evpn: fix exit-node with multiple vrf

Alexandre Derumier aderumier at odiso.com
Tue Apr 11 13:58:32 CEST 2023


Currently, if a node is primary exit-node for 1 vrf,
and secondary exit-node for another vrf,

the deny route-map is filtering routes imports for both
vrf.

This patch add filtering only for vrf where the node is secondary.

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Network/SDN/Controllers/EvpnPlugin.pm                        | 1 +
 test/zones/evpn/exitnode/expected_controller_config              | 1 +
 .../zones/evpn/exitnode_local_routing/expected_controller_config | 1 +
 test/zones/evpn/exitnode_snat/expected_controller_config         | 1 +
 4 files changed, 4 insertions(+)

diff --git a/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
index 727aeaa..9d39b9b 100644
--- a/PVE/Network/SDN/Controllers/EvpnPlugin.pm
+++ b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
@@ -168,6 +168,7 @@ sub generate_controller_zone_config {
 	if (!$exitnodes_primary || $exitnodes_primary eq $local_node) {
 	    #filter default type5 route coming from other exit nodes on primary node or both nodes if no primary is defined.
 	    my $routemap_config = ();
+	    push @{$routemap_config}, "match evpn vni $vrfvxlan";
 	    push @{$routemap_config}, "match evpn route-type prefix";
 	    my $routemap = { rule => $routemap_config, action => "deny" };
 	    unshift(@{$config->{frr_routemap}->{'MAP_VTEP_IN'}}, $routemap);
diff --git a/test/zones/evpn/exitnode/expected_controller_config b/test/zones/evpn/exitnode/expected_controller_config
index 48830a3..2c3f19e 100644
--- a/test/zones/evpn/exitnode/expected_controller_config
+++ b/test/zones/evpn/exitnode/expected_controller_config
@@ -53,6 +53,7 @@ router bgp 65000 vrf vrf_myzone
 exit
 !
 route-map MAP_VTEP_IN deny 1
+ match evpn vni 1000
  match evpn route-type prefix
 exit
 !
diff --git a/test/zones/evpn/exitnode_local_routing/expected_controller_config b/test/zones/evpn/exitnode_local_routing/expected_controller_config
index f671b63..c557a7e 100644
--- a/test/zones/evpn/exitnode_local_routing/expected_controller_config
+++ b/test/zones/evpn/exitnode_local_routing/expected_controller_config
@@ -38,6 +38,7 @@ router bgp 65000 vrf vrf_myzone
 exit
 !
 route-map MAP_VTEP_IN deny 1
+ match evpn vni 1000
  match evpn route-type prefix
 exit
 !
diff --git a/test/zones/evpn/exitnode_snat/expected_controller_config b/test/zones/evpn/exitnode_snat/expected_controller_config
index 48830a3..2c3f19e 100644
--- a/test/zones/evpn/exitnode_snat/expected_controller_config
+++ b/test/zones/evpn/exitnode_snat/expected_controller_config
@@ -53,6 +53,7 @@ router bgp 65000 vrf vrf_myzone
 exit
 !
 route-map MAP_VTEP_IN deny 1
+ match evpn vni 1000
  match evpn route-type prefix
 exit
 !
-- 
2.30.2





More information about the pve-devel mailing list