diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-09-30 15:48:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-30 15:48:56 +0100 |
commit | eb55965347e53ac1dc336fe836b370a1f3e10a85 (patch) | |
tree | a076141622ec1e41133ef998076b21ce1b2abaac /python/vyos/nat.py | |
parent | 0195aa1b0e99b6e886168c89fd2d018181918125 (diff) | |
parent | 4c3d037f036e84c77333a400b35bb1a628a1a118 (diff) | |
download | vyos-1x-eb55965347e53ac1dc336fe836b370a1f3e10a85.tar.gz vyos-1x-eb55965347e53ac1dc336fe836b370a1f3e10a85.zip |
Merge pull request #4024 from nicolas-fort/T6687
T6687: add fqdn support to nat rules.
Diffstat (limited to 'python/vyos/nat.py')
-rw-r--r-- | python/vyos/nat.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/python/vyos/nat.py b/python/vyos/nat.py index 5fab3c2a1..29f8e961b 100644 --- a/python/vyos/nat.py +++ b/python/vyos/nat.py @@ -242,6 +242,13 @@ def parse_nat_rule(rule_conf, rule_id, nat_type, ipv6=False): output.append(f'{proto} {prefix}port {operator} @P_{group_name}') + if 'fqdn' in side_conf: + fqdn = side_conf['fqdn'] + operator = '' + if fqdn[0] == '!': + operator = '!=' + output.append(f' ip {prefix}addr {operator} @FQDN_nat_{nat_type}_{rule_id}_{prefix}') + output.append('counter') if 'log' in rule_conf: |