diff options
| author | Alexandre Derumier <aderumier@odiso.com> | 2022-02-11 10:33:27 +0100 |
|---|---|---|
| committer | Thomas Lamprecht <t.lamprecht@proxmox.com> | 2022-02-13 14:23:36 +0100 |
| commit | f34a898e01f3a9f80e39c37d4fd120b1e74c9fe8 (patch) | |
| tree | 1c1e0bc80b0544063ad7f196e91cc3fab72fcb21 /PVE/Network/SDN/Controllers/EvpnPlugin.pm | |
| parent | 847f51445231e827bfa6b5c81ac38ae80fd89e05 (diff) | |
controllers: evpn: add missing bgp router-id in vrf
evpn route distinguisher is compute from bgp router-id.
if not defined, it take random ip or 0.0.0.0 and could result collisions between hosts
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Diffstat (limited to 'PVE/Network/SDN/Controllers/EvpnPlugin.pm')
| -rw-r--r-- | PVE/Network/SDN/Controllers/EvpnPlugin.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/PVE/Network/SDN/Controllers/EvpnPlugin.pm index 2b48e9a..96abb9f 100644 --- a/PVE/Network/SDN/Controllers/EvpnPlugin.pm +++ b/PVE/Network/SDN/Controllers/EvpnPlugin.pm @@ -123,6 +123,7 @@ sub generate_controller_zone_config { my $exitnodes_local_routing = $plugin_config->{'exitnodes-local-routing'}; my $asn = $controller->{asn}; + my @peers = PVE::Tools::split_list($controller->{'peers'}) if $controller->{'peers'}; my $ebgp = undef; my $loopback = undef; my $autortas = undef; @@ -136,6 +137,8 @@ sub generate_controller_zone_config { return if !$vrf || !$vrfvxlan || !$asn; + my ($ifaceip, $interface) = PVE::Network::SDN::Zones::Plugin::find_local_ip_interface_peers(\@peers, $loopback); + # vrf my @controller_config = (); push @controller_config, "vni $vrfvxlan"; @@ -143,6 +146,7 @@ sub generate_controller_zone_config { #main vrf router @controller_config = (); + push @controller_config, "bgp router-id $ifaceip"; push @controller_config, "no bgp ebgp-requires-policy" if $ebgp; # push @controller_config, "!"; push(@{$config->{frr}->{router}->{"bgp $asn vrf $vrf"}->{""}}, @controller_config); |
