summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2026-03-16 13:23:53 +0000
committerGitHub <noreply@github.com>2026-03-16 13:23:53 +0000
commitc550c01277ef22c1556aab380887744345a46c92 (patch)
tree94ec7a5abc783165a24a92ddf0b76c87d4a4dd7b /src
parent6e2606008e156758bbc8dc0f62290a84ba5507cd (diff)
parent87d9d1e801f7306439dcd79d3c9876225f983111 (diff)
downloadvyos-1x-c550c01277ef22c1556aab380887744345a46c92.tar.gz
vyos-1x-c550c01277ef22c1556aab380887744345a46c92.zip
Merge pull request #5049 from natali-rs1985/T8368
vpp: T8368: Features nat44 and cgnat should not use the same interfaces
Diffstat (limited to 'src')
-rw-r--r--src/conf_mode/vpp_nat_cgnat.py10
-rw-r--r--src/conf_mode/vpp_nat_nat44.py10
2 files changed, 20 insertions, 0 deletions
diff --git a/src/conf_mode/vpp_nat_cgnat.py b/src/conf_mode/vpp_nat_cgnat.py
index 48d0339b1..2044a07b9 100644
--- a/src/conf_mode/vpp_nat_cgnat.py
+++ b/src/conf_mode/vpp_nat_cgnat.py
@@ -25,6 +25,7 @@ from vyos.vpp.utils import vpp_iface_name_transform
from vyos.vpp.nat.det44 import Det44
from vyos.vpp.control_vpp import VPPControl
+from vyos.vpp.config_verify import verify_nat_interfaces
protocol_map = {
'all': 0,
@@ -107,6 +108,13 @@ def get_config(config=None) -> dict:
}
)
+ config['nat44_config'] = conf.get_config_dict(
+ ['vpp', 'nat', 'nat44'],
+ key_mangling=('-', '_'),
+ get_first_key=True,
+ no_tag_node_value_mangle=True,
+ )
+
if effective_config:
config.update({'effective': effective_config})
@@ -139,6 +147,8 @@ def verify(config):
f'Please choose a side for: {", ".join(conflict_ifaces)} '
)
+ verify_nat_interfaces(config, 'nat44')
+
vpp = VPPControl()
for direction in ['inside', 'outside']:
for interface in config['interface'][direction]:
diff --git a/src/conf_mode/vpp_nat_nat44.py b/src/conf_mode/vpp_nat_nat44.py
index 30111bf40..7f0b27541 100644
--- a/src/conf_mode/vpp_nat_nat44.py
+++ b/src/conf_mode/vpp_nat_nat44.py
@@ -29,6 +29,7 @@ from vyos.vpp.utils import cli_ifaces_list
from vyos.vpp.utils import vpp_iface_name_transform
from vyos.vpp.nat.nat44 import Nat44
from vyos.vpp.control_vpp import VPPControl
+from vyos.vpp.config_verify import verify_nat_interfaces
protocol_map = {
@@ -113,6 +114,13 @@ def get_config(config=None) -> dict:
}
)
+ config['cgnat_config'] = conf.get_config_dict(
+ ['vpp', 'nat', 'cgnat'],
+ key_mangling=('-', '_'),
+ get_first_key=True,
+ no_tag_node_value_mangle=True,
+ )
+
if effective_config:
config.update({'effective': effective_config})
@@ -153,6 +161,8 @@ def verify(config):
f'Both inside and outside interfaces must be configured. Please add: {", ".join(missing_keys)}'
)
+ verify_nat_interfaces(config, 'cgnat')
+
vpp = VPPControl()
for direction in ['inside', 'outside']:
for interface in config['interface'][direction]: