diff options
| author | Nataliia Solomko <natalirs1985@gmail.com> | 2025-11-28 16:30:41 +0200 |
|---|---|---|
| committer | Nataliia Solomko <natalirs1985@gmail.com> | 2025-12-04 16:47:30 +0200 |
| commit | e091fb8bd87da8c9cd56f3435b39134b917a57a2 (patch) | |
| tree | 7301f3442e7c529509c9c74b38f73be1d3cc71d5 /src/conf_mode | |
| parent | 81eb7510621b3aa478359117733204bc7f140931 (diff) | |
| download | vyos-1x-e091fb8bd87da8c9cd56f3435b39134b917a57a2.tar.gz vyos-1x-e091fb8bd87da8c9cd56f3435b39134b917a57a2.zip | |
vpp: T7972: Make `nat44 no-forwarding` feature automatically configurable
If any dynamic rule is configured forwarding should be disabled because each
packet must be processed through the NAT session table to apply proper
translations
Diffstat (limited to 'src/conf_mode')
| -rw-r--r-- | src/conf_mode/vpp_nat.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/conf_mode/vpp_nat.py b/src/conf_mode/vpp_nat.py index 468424016..6e4ebc1b4 100644 --- a/src/conf_mode/vpp_nat.py +++ b/src/conf_mode/vpp_nat.py @@ -439,10 +439,10 @@ def apply(config): # Add NAT44 n.enable_nat44_ed() - # Enable/disable forwarding - enable_forwarding = True - if 'no_forwarding' in config: - enable_forwarding = False + # Dynamic rules always require `address-pool translation` in CLI - we can use this for an easy validation + # Forwarding must be disabled when dynamic rules are present + # Without dynamic rules, forwarding remains enabled + enable_forwarding = not bool(config.get('address_pool', {}).get('translation')) n.enable_disable_nat44_forwarding(enable_forwarding) # Add inside interfaces |
