]> git.proxmox.com Git - pve-network.git/blobdiff - PVE/Network/SDN/Controllers/EvpnPlugin.pm
zones: evpn : add rt-import
[pve-network.git] / PVE / Network / SDN / Controllers / EvpnPlugin.pm
index 96abb9f0ab90ffa007db29e947aa28a2afb8cb03..6d9b059ebba24f9928b20652bf2d3fe3b9b8e263 100644 (file)
@@ -121,6 +121,7 @@ sub generate_controller_zone_config {
     my $exitnodes_primary = $plugin_config->{'exitnodes-primary'};
     my $advertisesubnets = $plugin_config->{'advertise-subnets'};
     my $exitnodes_local_routing = $plugin_config->{'exitnodes-local-routing'};
+    my $rt_import = [PVE::Tools::split_list($plugin_config->{'rt-import'})] if $plugin_config->{'rt-import'};
 
     my $asn = $controller->{asn};
     my @peers = PVE::Tools::split_list($controller->{'peers'}) if $controller->{'peers'};
@@ -202,6 +203,14 @@ sub generate_controller_zone_config {
        push(@{$config->{frr}->{router}->{"bgp $asn vrf $vrf"}->{"address-family"}->{"l2vpn evpn"}}, @controller_config);
     }
 
+    if($rt_import) {
+       @controller_config = ();
+       foreach my $rt (sort @{$rt_import}) {
+           push @controller_config, "route-target import $rt";
+       }
+       push(@{$config->{frr}->{router}->{"bgp $asn vrf $vrf"}->{"address-family"}->{"l2vpn evpn"}}, @controller_config);
+    }
+
     return $config;
 }