[pve-devel] [PATCH pve-network 3/3] frr: config : add exit on router && routemaps.

Alexandre Derumier aderumier at odiso.com
Wed Aug 24 10:56:46 CEST 2022


added recently in last frr releases,

just to be sure to no break on future releases

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Network/SDN/Controllers/EvpnPlugin.pm                    | 5 +++++
 test/zones/evpn/advertise_subnets/expected_controller_config | 4 ++++
 .../disable_arp_nd_suppression/expected_controller_config    | 4 ++++
 test/zones/evpn/ebgp/expected_controller_config              | 4 ++++
 test/zones/evpn/ebgp_loopback/expected_controller_config     | 5 +++++
 test/zones/evpn/exitnode/expected_controller_config          | 5 +++++
 .../evpn/exitnode_local_routing/expected_controller_config   | 5 +++++
 test/zones/evpn/exitnode_primary/expected_controller_config  | 5 +++++
 test/zones/evpn/exitnode_snat/expected_controller_config     | 5 +++++
 test/zones/evpn/ipv4/expected_controller_config              | 4 ++++
 test/zones/evpn/ipv4ipv6/expected_controller_config          | 4 ++++
 test/zones/evpn/ipv4ipv6nogateway/expected_controller_config | 4 ++++
 test/zones/evpn/ipv6/expected_controller_config              | 4 ++++
 test/zones/evpn/multipath_relax/expected_controller_config   | 4 ++++
 test/zones/evpn/rt_import/expected_controller_config         | 4 ++++
 15 files changed, 66 insertions(+)

diff --git a/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
index 2bc10f5..857ad04 100644
--- a/PVE/Network/SDN/Controllers/EvpnPlugin.pm
+++ b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
@@ -325,6 +325,9 @@ sub generate_frr_recurse{
    $exitkeylist->{vrf} = 1;
    $exitkeylist->{'address-family'} = 1;
 
+   my $simple_exitkeylist = {};
+   $simple_exitkeylist->{router} = 1;
+
    # FIXME: make this generic
    my $paddinglevel = undef;
    if ($level == 1 || $level == 2) {
@@ -349,6 +352,7 @@ sub generate_frr_recurse{
 	    generate_frr_recurse($final_config, $option, $key, $level+1);
 
 	    push @{$final_config}, $padding."exit-$parentkey" if $parentkey && defined($exitkeylist->{$parentkey});
+	    push @{$final_config}, $padding."exit" if $parentkey && defined($simple_exitkeylist->{$parentkey});
 	}
     }
 
@@ -373,6 +377,7 @@ sub generate_frr_routemap {
 		my $rule = $seq->{rule};
 		push @config, map { " $_" } @$rule;
 		push @{$final_config}, @config;
+		push @{$final_config}, "exit";
 	}
    }
 }
diff --git a/test/zones/evpn/advertise_subnets/expected_controller_config b/test/zones/evpn/advertise_subnets/expected_controller_config
index 1a7fea2..82b06b4 100644
--- a/test/zones/evpn/advertise_subnets/expected_controller_config
+++ b/test/zones/evpn/advertise_subnets/expected_controller_config
@@ -25,6 +25,7 @@ router bgp 65000
   neighbor VTEP activate
   advertise-all-vni
  exit-address-family
+exit
 !
 router bgp 65000 vrf vrf_myzone
  bgp router-id 192.168.0.1
@@ -41,10 +42,13 @@ router bgp 65000 vrf vrf_myzone
   advertise ipv4 unicast
   advertise ipv6 unicast
  exit-address-family
+exit
 !
 route-map MAP_VTEP_IN permit 1
+exit
 !
 route-map MAP_VTEP_OUT permit 1
+exit
 !
 line vty
 !
\ No newline at end of file
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 7b6caf6..bd7830a 100644
--- a/test/zones/evpn/disable_arp_nd_suppression/expected_controller_config
+++ b/test/zones/evpn/disable_arp_nd_suppression/expected_controller_config
@@ -25,13 +25,17 @@ router bgp 65000
   neighbor VTEP activate
   advertise-all-vni
  exit-address-family
+exit
 !
 router bgp 65000 vrf vrf_myzone
  bgp router-id 192.168.0.1
+exit
 !
 route-map MAP_VTEP_IN permit 1
+exit
 !
 route-map MAP_VTEP_OUT permit 1
+exit
 !
 line vty
 !
\ No newline at end of file
diff --git a/test/zones/evpn/ebgp/expected_controller_config b/test/zones/evpn/ebgp/expected_controller_config
index 20e7dce..ccc0b28 100644
--- a/test/zones/evpn/ebgp/expected_controller_config
+++ b/test/zones/evpn/ebgp/expected_controller_config
@@ -37,6 +37,7 @@ router bgp 65001
   advertise-all-vni
   autort as 65000
  exit-address-family
+exit
 !
 router bgp 65001 vrf vrf_myzone
  bgp router-id 192.168.0.1
@@ -45,10 +46,13 @@ router bgp 65001 vrf vrf_myzone
   route-target import 65000:1000
   route-target export 65000:1000
  exit-address-family
+exit
 !
 route-map MAP_VTEP_IN permit 1
+exit
 !
 route-map MAP_VTEP_OUT permit 1
+exit
 !
 line vty
 !
\ No newline at end of file
diff --git a/test/zones/evpn/ebgp_loopback/expected_controller_config b/test/zones/evpn/ebgp_loopback/expected_controller_config
index 9c53a58..64fca31 100644
--- a/test/zones/evpn/ebgp_loopback/expected_controller_config
+++ b/test/zones/evpn/ebgp_loopback/expected_controller_config
@@ -42,6 +42,7 @@ router bgp 65001
   advertise-all-vni
   autort as 65000
  exit-address-family
+exit
 !
 router bgp 65001 vrf vrf_myzone
  bgp router-id 192.168.0.1
@@ -50,14 +51,18 @@ router bgp 65001 vrf vrf_myzone
   route-target import 65000:1000
   route-target export 65000:1000
  exit-address-family
+exit
 !
 route-map MAP_VTEP_IN permit 1
+exit
 !
 route-map MAP_VTEP_OUT permit 1
+exit
 !
 route-map correct_src permit 1
  match ip address prefix-list loopbacks_ips
  set src 192.168.0.1
+exit
 !
 line vty
 !
\ No newline at end of file
diff --git a/test/zones/evpn/exitnode/expected_controller_config b/test/zones/evpn/exitnode/expected_controller_config
index 7fa9b23..48830a3 100644
--- a/test/zones/evpn/exitnode/expected_controller_config
+++ b/test/zones/evpn/exitnode/expected_controller_config
@@ -33,6 +33,7 @@ router bgp 65000
   neighbor VTEP activate
   advertise-all-vni
  exit-address-family
+exit
 !
 router bgp 65000 vrf vrf_myzone
  bgp router-id 192.168.0.1
@@ -49,13 +50,17 @@ router bgp 65000 vrf vrf_myzone
   default-originate ipv4
   default-originate ipv6
  exit-address-family
+exit
 !
 route-map MAP_VTEP_IN deny 1
  match evpn route-type prefix
+exit
 !
 route-map MAP_VTEP_IN permit 2
+exit
 !
 route-map MAP_VTEP_OUT permit 1
+exit
 !
 line vty
 !
\ No newline at end of file
diff --git a/test/zones/evpn/exitnode_local_routing/expected_controller_config b/test/zones/evpn/exitnode_local_routing/expected_controller_config
index 5ddb42b..f671b63 100644
--- a/test/zones/evpn/exitnode_local_routing/expected_controller_config
+++ b/test/zones/evpn/exitnode_local_routing/expected_controller_config
@@ -26,6 +26,7 @@ router bgp 65000
   neighbor VTEP activate
   advertise-all-vni
  exit-address-family
+exit
 !
 router bgp 65000 vrf vrf_myzone
  bgp router-id 192.168.0.1
@@ -34,13 +35,17 @@ router bgp 65000 vrf vrf_myzone
   default-originate ipv4
   default-originate ipv6
  exit-address-family
+exit
 !
 route-map MAP_VTEP_IN deny 1
  match evpn route-type prefix
+exit
 !
 route-map MAP_VTEP_IN permit 2
+exit
 !
 route-map MAP_VTEP_OUT permit 1
+exit
 !
 line vty
 !
\ No newline at end of file
diff --git a/test/zones/evpn/exitnode_primary/expected_controller_config b/test/zones/evpn/exitnode_primary/expected_controller_config
index 3155866..e45b22c 100644
--- a/test/zones/evpn/exitnode_primary/expected_controller_config
+++ b/test/zones/evpn/exitnode_primary/expected_controller_config
@@ -33,6 +33,7 @@ router bgp 65000
   neighbor VTEP activate
   advertise-all-vni
  exit-address-family
+exit
 !
 router bgp 65000 vrf vrf_myzone
  bgp router-id 192.168.0.1
@@ -49,15 +50,19 @@ router bgp 65000 vrf vrf_myzone
   default-originate ipv4
   default-originate ipv6
  exit-address-family
+exit
 !
 route-map MAP_VTEP_IN permit 1
+exit
 !
 route-map MAP_VTEP_OUT permit 1
  match evpn vni 1000
  match evpn route-type prefix
  set metric 200
+exit
 !
 route-map MAP_VTEP_OUT permit 2
+exit
 !
 line vty
 !
\ No newline at end of file
diff --git a/test/zones/evpn/exitnode_snat/expected_controller_config b/test/zones/evpn/exitnode_snat/expected_controller_config
index 7fa9b23..48830a3 100644
--- a/test/zones/evpn/exitnode_snat/expected_controller_config
+++ b/test/zones/evpn/exitnode_snat/expected_controller_config
@@ -33,6 +33,7 @@ router bgp 65000
   neighbor VTEP activate
   advertise-all-vni
  exit-address-family
+exit
 !
 router bgp 65000 vrf vrf_myzone
  bgp router-id 192.168.0.1
@@ -49,13 +50,17 @@ router bgp 65000 vrf vrf_myzone
   default-originate ipv4
   default-originate ipv6
  exit-address-family
+exit
 !
 route-map MAP_VTEP_IN deny 1
  match evpn route-type prefix
+exit
 !
 route-map MAP_VTEP_IN permit 2
+exit
 !
 route-map MAP_VTEP_OUT permit 1
+exit
 !
 line vty
 !
\ No newline at end of file
diff --git a/test/zones/evpn/ipv4/expected_controller_config b/test/zones/evpn/ipv4/expected_controller_config
index 7b6caf6..bd7830a 100644
--- a/test/zones/evpn/ipv4/expected_controller_config
+++ b/test/zones/evpn/ipv4/expected_controller_config
@@ -25,13 +25,17 @@ router bgp 65000
   neighbor VTEP activate
   advertise-all-vni
  exit-address-family
+exit
 !
 router bgp 65000 vrf vrf_myzone
  bgp router-id 192.168.0.1
+exit
 !
 route-map MAP_VTEP_IN permit 1
+exit
 !
 route-map MAP_VTEP_OUT permit 1
+exit
 !
 line vty
 !
\ No newline at end of file
diff --git a/test/zones/evpn/ipv4ipv6/expected_controller_config b/test/zones/evpn/ipv4ipv6/expected_controller_config
index 7b6caf6..bd7830a 100644
--- a/test/zones/evpn/ipv4ipv6/expected_controller_config
+++ b/test/zones/evpn/ipv4ipv6/expected_controller_config
@@ -25,13 +25,17 @@ router bgp 65000
   neighbor VTEP activate
   advertise-all-vni
  exit-address-family
+exit
 !
 router bgp 65000 vrf vrf_myzone
  bgp router-id 192.168.0.1
+exit
 !
 route-map MAP_VTEP_IN permit 1
+exit
 !
 route-map MAP_VTEP_OUT permit 1
+exit
 !
 line vty
 !
\ No newline at end of file
diff --git a/test/zones/evpn/ipv4ipv6nogateway/expected_controller_config b/test/zones/evpn/ipv4ipv6nogateway/expected_controller_config
index 7b6caf6..bd7830a 100644
--- a/test/zones/evpn/ipv4ipv6nogateway/expected_controller_config
+++ b/test/zones/evpn/ipv4ipv6nogateway/expected_controller_config
@@ -25,13 +25,17 @@ router bgp 65000
   neighbor VTEP activate
   advertise-all-vni
  exit-address-family
+exit
 !
 router bgp 65000 vrf vrf_myzone
  bgp router-id 192.168.0.1
+exit
 !
 route-map MAP_VTEP_IN permit 1
+exit
 !
 route-map MAP_VTEP_OUT permit 1
+exit
 !
 line vty
 !
\ No newline at end of file
diff --git a/test/zones/evpn/ipv6/expected_controller_config b/test/zones/evpn/ipv6/expected_controller_config
index 7b6caf6..bd7830a 100644
--- a/test/zones/evpn/ipv6/expected_controller_config
+++ b/test/zones/evpn/ipv6/expected_controller_config
@@ -25,13 +25,17 @@ router bgp 65000
   neighbor VTEP activate
   advertise-all-vni
  exit-address-family
+exit
 !
 router bgp 65000 vrf vrf_myzone
  bgp router-id 192.168.0.1
+exit
 !
 route-map MAP_VTEP_IN permit 1
+exit
 !
 route-map MAP_VTEP_OUT permit 1
+exit
 !
 line vty
 !
\ No newline at end of file
diff --git a/test/zones/evpn/multipath_relax/expected_controller_config b/test/zones/evpn/multipath_relax/expected_controller_config
index b2df0b5..2d1ad44 100644
--- a/test/zones/evpn/multipath_relax/expected_controller_config
+++ b/test/zones/evpn/multipath_relax/expected_controller_config
@@ -37,13 +37,17 @@ router bgp 65000
   neighbor VTEP activate
   advertise-all-vni
  exit-address-family
+exit
 !
 router bgp 65000 vrf vrf_myzone
  bgp router-id 192.168.0.1
+exit
 !
 route-map MAP_VTEP_IN permit 1
+exit
 !
 route-map MAP_VTEP_OUT permit 1
+exit
 !
 line vty
 !
\ No newline at end of file
diff --git a/test/zones/evpn/rt_import/expected_controller_config b/test/zones/evpn/rt_import/expected_controller_config
index 3fd6870..f4f28dd 100644
--- a/test/zones/evpn/rt_import/expected_controller_config
+++ b/test/zones/evpn/rt_import/expected_controller_config
@@ -25,6 +25,7 @@ router bgp 65000
   neighbor VTEP activate
   advertise-all-vni
  exit-address-family
+exit
 !
 router bgp 65000 vrf vrf_myzone
  bgp router-id 192.168.0.1
@@ -34,10 +35,13 @@ router bgp 65000 vrf vrf_myzone
   route-target import 65002:1000
   route-target import 65003:1000
  exit-address-family
+exit
 !
 route-map MAP_VTEP_IN permit 1
+exit
 !
 route-map MAP_VTEP_OUT permit 1
+exit
 !
 line vty
 !
\ No newline at end of file
-- 
2.30.2





More information about the pve-devel mailing list