[pve-devel] [PATCH pve-network 1/2] evpn: add support for local frr.config

Alexandre Derumier aderumier at odiso.com
Thu Jan 16 09:15:15 CET 2020


For users with complex setup (underlay ebgp for example),
allow user to add a /etc/frr/frr.conf.local

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Network/SDN/Controllers/EvpnPlugin.pm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
index c8bf76a..6369c45 100644
--- a/PVE/Network/SDN/Controllers/EvpnPlugin.pm
+++ b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
@@ -262,7 +262,18 @@ sub write_controller_config {
     push @{$final_config}, "hostname $nodename";
     push @{$final_config}, "!";
 
-    generate_frr_recurse($final_config, $config->{frr}, undef, 0);
+    if (-e "/etc/frr/frr.conf.local") {
+	open my $fh, '<', '/etc/frr/frr.conf.local' or die "Can't open file $!";
+	generate_frr_recurse($final_config, $config->{frr}->{vrf}, "vrf", 1);
+	push @{$final_config}, "!";
+
+	while (my $line = <$fh>) {
+	    chomp ($line);
+	    push @{$final_config}, $line;
+	}
+    } else {
+	generate_frr_recurse($final_config, $config->{frr}, undef, 0);
+    }
 
     push @{$final_config}, "!";
     push @{$final_config}, "line vty";
-- 
2.20.1




More information about the pve-devel mailing list