summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/nat66.py9
-rwxr-xr-xsrc/migration-scripts/nat66/0-to-11
2 files changed, 2 insertions, 8 deletions
diff --git a/src/conf_mode/nat66.py b/src/conf_mode/nat66.py
index f58db04e0..b90939a2f 100755
--- a/src/conf_mode/nat66.py
+++ b/src/conf_mode/nat66.py
@@ -80,19 +80,16 @@ def get_config(config=None):
if not conf.exists(base):
nat['helper_functions'] = 'remove'
-
nat['pre_ct_conntrack'] = get_handler(condensed_json, 'PREROUTING', 'NAT_CONNTRACK')
nat['out_ct_conntrack'] = get_handler(condensed_json, 'OUTPUT','NAT_CONNTRACK')
-
nat['deleted'] = ''
-
return nat
# check if NAT66 connection tracking helpers need to be set up - this has to
# be done only once
if not get_handler(condensed_json, 'PREROUTING', 'NAT_CONNTRACK'):
nat['helper_functions'] = 'add'
-
+
# Retrieve current table handler positions
nat['pre_ct_conntrack'] = get_handler(condensed_json, 'PREROUTING', 'VYATTA_CT_PREROUTING_HOOK')
nat['out_ct_conntrack'] = get_handler(condensed_json, 'OUTPUT','VYATTA_CT_OUTPUT_HOOK')
@@ -120,18 +117,16 @@ def verify(nat):
if config['outbound_interface'] not in interfaces():
print(f'WARNING: rule "{rule}" interface "{config["outbound_interface"]}" does not exist on this system')
-
prefix = dict_search('translation.prefix', config)
if prefix != None:
if not is_ipv6(prefix):
raise ConfigError(f'Warning: IPv6 prefix {prefix} is not a valid address prefix')
-
+
prefix = dict_search('source.prefix', config)
if prefix != None:
if not is_ipv6(prefix):
raise ConfigError(f'{err_msg} source-prefix not specified')
-
if dict_search('destination.rule', nat):
for rule, config in dict_search('destination.rule', nat).items():
err_msg = f'Destination NAT66 configuration error in rule {rule}:'
diff --git a/src/migration-scripts/nat66/0-to-1 b/src/migration-scripts/nat66/0-to-1
index 602c5f5c1..74d64c07b 100755
--- a/src/migration-scripts/nat66/0-to-1
+++ b/src/migration-scripts/nat66/0-to-1
@@ -51,7 +51,6 @@ def merge_npt(config,base,rule):
tmp = config.return_value(base + ['translation','prefix'])
config.set(merge_base + ['translation','prefix'],value=tmp)
-
if not config.exists(['nat', 'nptv6']):
# Nothing to do
exit(0)