]> git.puffer.fish Git - mirror/pve-network.git/commitdiff
evpn : remove "ip route add vrf vrf_myzone unreachable default metric 4278198272...
authorAlexandre Derumier <aderumier@odiso.com>
Wed, 21 Jul 2021 06:22:28 +0000 (08:22 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 21 Jul 2021 07:38:13 +0000 (09:38 +0200)
This is breaking routing between the evpn vrf && default vrf leak  on exit node only

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/Network/SDN/Zones/EvpnPlugin.pm
test/zones/evpn/exitnode/expected_sdn_interfaces
test/zones/evpn/exitnode_snat/expected_sdn_interfaces

index 4fa46f71e17538f41bd1257b1777a628f98ea48e..6dd970b8c945402ed90b3320501298c99b0a8fe7 100644 (file)
@@ -73,6 +73,7 @@ sub generate_sdn_config {
     my $bgprouter = PVE::Network::SDN::Controllers::EvpnPlugin::find_bgp_controller($local_node, $controller_cfg);
     my $loopback = $bgprouter->{loopback} if $bgprouter->{loopback};
     my ($ifaceip, $iface) = PVE::Network::SDN::Zones::Plugin::find_local_ip_interface_peers(\@peers, $loopback);
+    my $is_evpn_gateway = $plugin_config->{'exitnodes'}->{$local_node};
 
     my $mtu = 1450;
     $mtu = $interfaces_config->{$iface}->{mtu} - 50 if $interfaces_config->{$iface}->{mtu};
@@ -127,8 +128,6 @@ sub generate_sdn_config {
 
        if ($subnet->{snat}) {
 
-           my $is_evpn_gateway = $plugin_config->{'exitnodes'}->{$local_node};
-
             #find outgoing interface
             my ($outip, $outiface) = PVE::Network::SDN::Zones::Plugin::get_local_route_ip($checkrouteip);
             if ($outip && $outiface && $is_evpn_gateway) {
@@ -158,7 +157,7 @@ sub generate_sdn_config {
        #vrf interface
        @iface_config = ();
        push @iface_config, "vrf-table auto";
-       push @iface_config, "post-up ip route add vrf $vrf_iface unreachable default metric 4278198272";
+       push @iface_config, "post-up ip route add vrf $vrf_iface unreachable default metric 4278198272" if !$is_evpn_gateway;
        push(@{$config->{$vrf_iface}}, @iface_config) if !$config->{$vrf_iface};
 
        if ($vrfvxlan) {
index 4cf13e05e6887d8df572cab730dd60c023f3fd00..ca691cdc83f8a9887089c2c5ad693c2b70f71b8a 100644 (file)
@@ -14,7 +14,6 @@ iface myvnet
 auto vrf_myzone
 iface vrf_myzone
        vrf-table auto
-       post-up ip route add vrf vrf_myzone unreachable default metric 4278198272
 
 auto vrfbr_myzone
 iface vrfbr_myzone
index a2a183ef1943d125f28c1691d3332d60de3d4abc..77168ad2031f72c4eea594adad099f1e1565c3b2 100644 (file)
@@ -33,7 +33,6 @@ iface myvnet2
 auto vrf_myzone
 iface vrf_myzone
        vrf-table auto
-       post-up ip route add vrf vrf_myzone unreachable default metric 4278198272
 
 auto vrfbr_myzone
 iface vrfbr_myzone