From: Lukas Sichert <l.sichert@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Lukas Sichert <l.sichert@proxmox.com>
Subject: [PATCH manager/network v3 0/7] fix #5066: make generated snat rules flushable
Date: Thu, 26 Nov 2026 16:28:58 +0100 [thread overview]
Message-ID: <20261126153925.54600-1-l.sichert@proxmox.com> (raw)
Disabling SNAT for an existing subnet can leave its iptables rule
active. This happens because 'ifreload -a' does not execute down hooks
when reloading an existing interface [1].
Move generated Simple (including dedicated VRF) and EVPN SNAT rules from
POSTROUTING into a dedicated chain. Post-up hooks prepare the complete
new ruleset in PROXMOX-SDN-NEW while the existing PROXMOX-SDN chain
remains active. After ifreload, replace the old chain with the prepared
one. This removes stale rules without affecting unrelated POSTROUTING
rules or leaving a window during which SNAT does not work.
At boot, networking.service prepares the temporary chain directly with
the post-up commands in /etc/network/interfaces.d/sdn. Therefore, also
activate it from pve-sdn-commit when no SDN changes are pending.
Maintainer Note:
This series requires a version bump of pve-network and a dependency bump
on it in pve-manager, as that calls the new apply_new_snat_rules().
Notes:
- Rules generated by an older version sit directly in POSTROUTING and
cannot be told apart from user-set rules, so they are not flushed with
the new chain and are only gone after a reboot.
- A manual ifreload populates PROXMOX-SDN-NEW without switching it over.
This may leave stale rules, which are cleaned up with the next SDN
apply or reboot.
[1] https://manpages.debian.org/testing/ifupdown2/ifreload.8.en.html
Link: https://bugzilla.proxmox.com/show_bug.cgi?id=5066
changes from v2 to v3 (thanks @Stefan):
- prepare rules in a temporary chain before replacing the active chain,
avoiding an interruption of SNAT
- share SNAT rule generation between Simple and EVPN zones
- activate rules generated during boot
- also handle zones with a dedicated VRF, which masquerade on their
uplinks
changes from v1 to v2 (thanks @Stefan):
- rebase on top of master
- create chain only when '$is_evpn_gateway' is true
- add Links to commits
network:
Lukas Sichert (6):
style: zones: use fully qualified JSONSchema calls for standard
options
fix #5066: zones: factor out SNAT rule generation
fix #5066: zones: add helper to activate prepared SNAT rules
fix #5066: evpn: prepare SNAT rules in temporary chain
fix #5066: simple zone: prepare SNAT rules in temporary chain
fix #5066: zones: add test for generating and applying SNAT rules
src/PVE/Network/SDN/Zones.pm | 39 +++-
src/PVE/Network/SDN/Zones/EvpnPlugin.pm | 31 +--
src/PVE/Network/SDN/Zones/Plugin.pm | 58 ++++-
src/PVE/Network/SDN/Zones/SimplePlugin.pm | 44 +---
src/test/Makefile | 5 +-
src/test/run_test_apply_snat.pl | 209 ++++++++++++++++++
.../exitnode_snat/expected_sdn_interfaces | 16 +-
.../simple/ipv4snat/expected_sdn_interfaces | 8 +-
.../simple/ipv6snat/expected_sdn_interfaces | 8 +-
.../simple/vrf_snat/expected_sdn_interfaces | 35 ++-
10 files changed, 348 insertions(+), 105 deletions(-)
create mode 100755 src/test/run_test_apply_snat.pl
manager:
Lukas Sichert (1):
fix #5066: network: activate prepared SDN SNAT rules
PVE/API2/Network.pm | 1 +
bin/pve-sdn-commit | 6 ++++++
2 files changed, 7 insertions(+)
Summary over all repositories:
12 files changed, 355 insertions(+), 105 deletions(-)
--
Generated by murpp 0.12.0
next reply other threads:[~2026-11-26 15:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 15:28 Lukas Sichert [this message]
2026-11-26 15:28 ` [PATCH network v3 1/7] style: zones: use fully qualified JSONSchema calls for standard options Lukas Sichert
2026-11-26 15:29 ` [PATCH network v3 2/7] fix #5066: zones: factor out SNAT rule generation Lukas Sichert
2026-11-26 15:29 ` [PATCH network v3 3/7] fix #5066: zones: add helper to activate prepared SNAT rules Lukas Sichert
2026-11-26 15:29 ` [PATCH network v3 4/7] fix #5066: evpn: prepare SNAT rules in temporary chain Lukas Sichert
2026-11-26 15:29 ` [PATCH network v3 5/7] fix #5066: simple zone: " Lukas Sichert
2026-11-26 15:29 ` [PATCH network v3 6/7] fix #5066: zones: add test for generating and applying SNAT rules Lukas Sichert
2026-11-26 15:29 ` [PATCH manager v3 7/7] fix #5066: network: activate prepared SDN " Lukas Sichert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261126153925.54600-1-l.sichert@proxmox.com \
--to=l.sichert@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox