From 8dcb042bb2352717395ba3c17bc5437534c83af5 Mon Sep 17 00:00:00 2001 From: Nicolas Fort Date: Fri, 30 Aug 2024 17:54:17 +0000 Subject: T6687: add fqdn support to nat rules. (cherry picked from commit 4c3d037f036e84c77333a400b35bb1a628a1a118) --- python/vyos/nat.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'python/vyos/nat.py') diff --git a/python/vyos/nat.py b/python/vyos/nat.py index e54548788..4fe21ef13 100644 --- a/python/vyos/nat.py +++ b/python/vyos/nat.py @@ -236,6 +236,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: -- cgit v1.2.3