diff options
| author | Alexandre Derumier <aderumier@odiso.com> | 2022-02-11 10:33:26 +0100 |
|---|---|---|
| committer | Thomas Lamprecht <t.lamprecht@proxmox.com> | 2022-02-13 14:23:36 +0100 |
| commit | 847f51445231e827bfa6b5c81ac38ae80fd89e05 (patch) | |
| tree | 6fc0e5dbb964a5332665a2e762aac34bb4e0a50c /PVE/Network/SDN/Controllers/BgpPlugin.pm | |
| parent | 9e6b99fd8ce76e0b032c44e53b148e9c6fc1aa54 (diff) | |
controllers: evpn/bgp : add exitnodes-primary && rework route-map
exitnodes-primary option force traffic to a primary node
A route-map is used to increase metric on backup nodes.
This can be usefull for snat or avoid asymetric routing.
Route-map is rework to handle multiple sequences of route map.
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Diffstat (limited to 'PVE/Network/SDN/Controllers/BgpPlugin.pm')
| -rw-r--r-- | PVE/Network/SDN/Controllers/BgpPlugin.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/PVE/Network/SDN/Controllers/BgpPlugin.pm b/PVE/Network/SDN/Controllers/BgpPlugin.pm index 1e4e708..70c7264 100644 --- a/PVE/Network/SDN/Controllers/BgpPlugin.pm +++ b/PVE/Network/SDN/Controllers/BgpPlugin.pm @@ -122,8 +122,11 @@ sub generate_controller_config { 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"); - push(@{$config->{frr}->{'route-map'}->{'correct_src permit 1'}}, "match ip address prefix-list loopbacks_ips"); - push(@{$config->{frr}->{'route-map'}->{'correct_src permit 1'}}, "set src $ifaceip"); + + 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; |
