sub properties {
return {
+ 'bgp-multipath-as-path-relax' => {
+ type => 'boolean',
+ optional => 1,
+ },
ebgp => {
type => 'boolean',
optional => 1,
description => "Enable ebgp. (remote-as external)",
},
+ 'ebgp-multihop' => {
+ type => 'integer',
+ optional => 1,
+ },
loopback => {
description => "source loopback interface.",
type => 'string'
'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 },
};
}
my $asn = $plugin_config->{asn};
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();
my @controller_config = (
"bgp router-id $ifaceip",
"no bgp default ipv4-unicast",
- "coalesce-time 1000",
- "bgp network import-check"
+ "coalesce-time 1000"
);
push(@{$bgp->{""}}, @controller_config) if keys %{$bgp} == 0;
@controller_config = ();
if($ebgp) {
- push @controller_config, "no bgp ebgp-requires-policy";
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";
push @controller_config, "neighbor BGP remote-as $remoteas";
push @controller_config, "neighbor BGP bfd";
+ push @controller_config, "neighbor BGP ebgp-multihop $ebgp_multihop" if $ebgp && $ebgp_multihop;
}
# BGP peers
push(@{$bgp->{"address-family"}->{"$ipversion unicast"}}, "neighbor BGP soft-reconfiguration inbound");
}
+ if ($loopback) {
+ push(@{$config->{frr}->{''}}, "ip prefix-list loopbacks_ips seq 10 permit 0.0.0.0/0 le 32");
+ push(@{$config->{frr}->{''}}, "ip protocol bgp route-map correct_src");
+
+ my $routemap_config = [];
+ push @{$routemap_config}, "match ip address prefix-list loopbacks_ips";
+ push @{$routemap_config}, "set src $ifaceip";
+ push(@{$config->{frr_routemap}->{'correct_src'}}, $routemap_config);
+ }
+
return $config;
}
}
}
+sub generate_controller_rawconfig {
+ my ($class, $plugin_config, $config) = @_;
+ return "";
+}
+
sub write_controller_config {
my ($class, $plugin_config, $config) = @_;
return;