summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-07-22 08:41:10 +0200
committerGitHub <noreply@github.com>2023-07-22 08:41:10 +0200
commit0ca6a8c2fdcdd5b2efe875831236504c161099a4 (patch)
tree7c07a345e193114d0a12d1486a5f51c86a9256f4 /src/conf_mode
parentc59765163885cc5bc54df9b194366f8713d065a1 (diff)
parent4c61fa82f59e26023993be56be1ff9bf0cb5251e (diff)
downloadvyos-1x-0ca6a8c2fdcdd5b2efe875831236504c161099a4.tar.gz
vyos-1x-0ca6a8c2fdcdd5b2efe875831236504c161099a4.zip
Merge pull request #2100 from nicolas-fort/T4889
T4889: NAT Redirect: adddestination nat redirection (to local host) feature.
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/nat.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/conf_mode/nat.py b/src/conf_mode/nat.py
index 5f4b658f8..e19b12937 100755
--- a/src/conf_mode/nat.py
+++ b/src/conf_mode/nat.py
@@ -72,6 +72,7 @@ def verify_rule(config, err_msg, groups_dict):
""" Common verify steps used for both source and destination NAT """
if (dict_search('translation.port', config) != None or
+ dict_search('translation.redirect.port', config) != None or
dict_search('destination.port', config) != None or
dict_search('source.port', config)):
@@ -221,7 +222,7 @@ def verify(nat):
elif config['inbound_interface'] not in 'any' and config['inbound_interface'] not in interfaces():
Warning(f'rule "{rule}" interface "{config["inbound_interface"]}" does not exist on this system')
- if not dict_search('translation.address', config) and not dict_search('translation.port', config):
+ if not dict_search('translation.address', config) and not dict_search('translation.port', config) and not dict_search('translation.redirect.port', config):
if 'exclude' not in config:
raise ConfigError(f'{err_msg} translation requires address and/or port')