From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id D90A51FF0DA for ; Thu, 19 Nov 2026 20:44:27 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 4D57A219EF; Thu, 19 Nov 2026 20:42:12 +0100 (CET) From: Gabriel Goller To: pve-devel@lists.proxmox.com Subject: [PATCH pve-network v3 22/28] sdn: evpn: no exit node null routes for simple zone VRFs Date: Thu, 19 Nov 2026 20:41:08 +0100 Message-ID: <20261119194116.575520-23-g.goller@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261119194116.575520-1-g.goller@proxmox.com> References: <20261119194116.575520-1-g.goller@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795117282990 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.165 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) PROLO_LEO1 0.1 Meta Catches all Leo drug variations so far RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 7BVVJK3HIZYQL7GWR5S2WRETOPYZ5A2C X-Message-ID-Hash: 7BVVJK3HIZYQL7GWR5S2WRETOPYZ5A2C X-MailFrom: g.goller@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Exit nodes add null routes for subnets of other zones, so that traffic falling through from the EVPN zone VRF to the main table is not routed into those zones. Subnets of simple zones with a dedicated VRF are not in the main table, so this is not needed. The null routes would also blackhole these prefixes for EVPN guests even when they are reachable over the uplink, e.g. when a dedicated VRF reuses an address range. Signed-off-by: Gabriel Goller --- src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 10 ++- .../expected_controller_config | 78 +++++++++++++++++++ .../expected_sdn_interfaces | 67 ++++++++++++++++ .../exitnodenullroute_simple_vrf/interfaces | 7 ++ .../exitnodenullroute_simple_vrf/sdn_config | 47 +++++++++++ 5 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 src/test/zones/evpn/exitnodenullroute_simple_vrf/expected_controller_config create mode 100644 src/test/zones/evpn/exitnodenullroute_simple_vrf/expected_sdn_interfaces create mode 100644 src/test/zones/evpn/exitnodenullroute_simple_vrf/interfaces create mode 100644 src/test/zones/evpn/exitnodenullroute_simple_vrf/sdn_config diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm index 67afe936ecc9..4a8c46258f2f 100644 --- a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm +++ b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm @@ -431,13 +431,21 @@ sub generate_zone_frr_config { # Add null routes for other zones to avoid routing between nodes through exit nodes if ($is_gateway) { my $subnets = PVE::Network::SDN::Vnets::get_subnets(); + my $zones = PVE::Network::SDN::Zones::config(1); my $cidrs = {}; foreach my $subnetid (sort keys %{$subnets}) { my $subnet = $subnets->{$subnetid}; my $cidr = $subnet->{cidr}; my $zone = $subnet->{zone}; + next if $zone eq $id; + + # Subnets of simple zones with a dedicated VRF are not routed in the default + # VRF, so traffic falling through from this VRF cannot reach them anyway. + my $zone_cfg = $zones->{ids}->{$zone}; + next if $zone_cfg && $zone_cfg->{type} eq 'simple' && $zone_cfg->{'dedicated-vrf'}; + my ($ip, $mask) = split(/\//, $cidr); - $cidrs->{$ip} = $mask if $zone ne $id; + $cidrs->{$ip} = $mask; } my @sorted_ip = diff --git a/src/test/zones/evpn/exitnodenullroute_simple_vrf/expected_controller_config b/src/test/zones/evpn/exitnodenullroute_simple_vrf/expected_controller_config new file mode 100644 index 000000000000..978986ca749e --- /dev/null +++ b/src/test/zones/evpn/exitnodenullroute_simple_vrf/expected_controller_config @@ -0,0 +1,78 @@ +frr version 10.6.1 +frr defaults datacenter +hostname localhost +log syslog informational +service integrated-vtysh-config +! +vrf vrf_myzone + vni 1000 + ip route 172.16.0.0/24 null0 +exit-vrf +! +router bgp 65000 + bgp router-id 192.168.0.1 + no bgp hard-administrative-reset + no bgp default ipv4-unicast + coalesce-time 1000 + no bgp graceful-restart notification + neighbor VTEP peer-group + neighbor VTEP remote-as 65000 + neighbor VTEP bfd + neighbor 192.168.0.2 peer-group VTEP + neighbor 192.168.0.3 peer-group VTEP + ! + address-family ipv4 unicast + import vrf vrf_myzone + exit-address-family + ! + address-family ipv6 unicast + import vrf vrf_myzone + exit-address-family + ! + address-family l2vpn evpn + neighbor VTEP activate + neighbor VTEP route-map MAP_VTEP_IN in + neighbor VTEP route-map MAP_VTEP_OUT out + advertise-all-vni + exit-address-family +exit +! +router bgp 65000 vrf vrf_myzone + bgp router-id 192.168.0.1 + no bgp hard-administrative-reset + no bgp graceful-restart notification + ! + address-family ipv4 unicast + redistribute connected + exit-address-family + ! + address-family ipv6 unicast + redistribute connected + exit-address-family + ! + address-family l2vpn evpn + default-originate ipv4 + default-originate ipv6 + exit-address-family +exit +! +ip prefix-list only_default seq 1 permit 0.0.0.0/0 +! +ipv6 prefix-list only_default_v6 seq 1 permit ::/0 +! +route-map MAP_VTEP_IN deny 1 + match ip address prefix-list only_default +exit +! +route-map MAP_VTEP_IN deny 2 + match ipv6 address prefix-list only_default_v6 +exit +! +route-map MAP_VTEP_IN permit 3 +exit +! +route-map MAP_VTEP_OUT permit 1 +exit +! +line vty +! diff --git a/src/test/zones/evpn/exitnodenullroute_simple_vrf/expected_sdn_interfaces b/src/test/zones/evpn/exitnodenullroute_simple_vrf/expected_sdn_interfaces new file mode 100644 index 000000000000..0735b88a3aaa --- /dev/null +++ b/src/test/zones/evpn/exitnodenullroute_simple_vrf/expected_sdn_interfaces @@ -0,0 +1,67 @@ +#version:1 + +auto myvnet +iface myvnet + address 10.0.0.1/24 + bridge_ports vxlan_myvnet + bridge_stp off + bridge_fd 0 + mtu 1450 + ip-forward on + arp-accept on + vrf vrf_myzone + +auto simplevnet +iface simplevnet + address 172.16.0.1/24 + bridge_ports none + bridge_stp off + bridge_fd 0 + ip-forward on + +auto vrf_myzone +iface vrf_myzone + vrf-table auto + post-up ip route del vrf vrf_myzone unreachable default metric 4278198272 + post-up ip -6 route del vrf vrf_myzone unreachable default metric 4278198272 || true + +auto vrf_vrfzone +iface vrf_vrfzone + vrf-table auto + post-up ip route add vrf vrf_vrfzone unreachable default metric 4278198272 + post-up ip -6 route add vrf vrf_vrfzone unreachable default metric 4278198272 || true + +auto vrfbr_myzone +iface vrfbr_myzone + bridge-ports vrfvx_myzone + bridge_stp off + bridge_fd 0 + mtu 1450 + vrf vrf_myzone + +auto vrfvnet +iface vrfvnet + address 172.16.1.1/24 + address 2b0f:1480::1/64 + bridge_ports none + bridge_stp off + bridge_fd 0 + ip-forward on + ip6-forward on + vrf vrf_vrfzone + +auto vrfvx_myzone +iface vrfvx_myzone + vxlan-id 1000 + vxlan-local-tunnelip 192.168.0.1 + bridge-learning off + bridge-arp-nd-suppress on + mtu 1450 + +auto vxlan_myvnet +iface vxlan_myvnet + vxlan-id 100 + vxlan-local-tunnelip 192.168.0.1 + bridge-learning off + bridge-arp-nd-suppress on + mtu 1450 diff --git a/src/test/zones/evpn/exitnodenullroute_simple_vrf/interfaces b/src/test/zones/evpn/exitnodenullroute_simple_vrf/interfaces new file mode 100644 index 000000000000..66bb826a44b3 --- /dev/null +++ b/src/test/zones/evpn/exitnodenullroute_simple_vrf/interfaces @@ -0,0 +1,7 @@ +auto vmbr0 +iface vmbr0 inet static + address 192.168.0.1/24 + gateway 192.168.0.254 + bridge-ports eth0 + bridge-stp off + bridge-fd 0 diff --git a/src/test/zones/evpn/exitnodenullroute_simple_vrf/sdn_config b/src/test/zones/evpn/exitnodenullroute_simple_vrf/sdn_config new file mode 100644 index 000000000000..8a5ee50dc101 --- /dev/null +++ b/src/test/zones/evpn/exitnodenullroute_simple_vrf/sdn_config @@ -0,0 +1,47 @@ +{ + version => 1, + vnets => { + ids => { + myvnet => { tag => "100", type => "vnet", zone => "myzone" }, + simplevnet => { type => "vnet", zone => "simple" }, + vrfvnet => { type => "vnet", zone => "vrfzone" }, + }, + }, + + zones => { + ids => { + myzone => { ipam => "pve", type => "evpn", controller => "evpnctl", 'vrf-vxlan' => 1000, exitnodes => { 'localhost' => 1 } }, + simple => { ipam => "pve", type => "simple" }, + vrfzone => { ipam => "pve", type => "simple", 'dedicated-vrf' => 1 }, + } + }, + controllers => { + ids => { evpnctl => { type => "evpn", 'peers' => '192.168.0.1,192.168.0.2,192.168.0.3', asn => "65000" } }, + }, + + subnets => { + ids => { + 'myzone-10.0.0.0-24' => { + 'type' => 'subnet', + 'vnet' => 'myvnet', + 'gateway' => '10.0.0.1', + }, + 'simple-172.16.0.0-24' => { + 'type' => 'subnet', + 'vnet' => 'simplevnet', + 'gateway' => '172.16.0.1', + }, + 'vrfzone-172.16.1.0-24' => { + 'type' => 'subnet', + 'vnet' => 'vrfvnet', + 'gateway' => '172.16.1.1', + }, + 'vrfzone-2b0f:1480::-64' => { + 'type' => 'subnet', + 'vnet' => 'vrfvnet', + 'gateway' => '2b0f:1480::1', + }, + } + } + +} -- 2.47.3