From 9cec8471dae531072946daf5dcb74a0a9fe1e86c Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 15 May 2020 23:01:27 +0200 Subject: nat: T2198: sync generated DNAT rules with VyOS 1.2 The generated NAT rules in VyOS 1.2 are compared to the generated nftables ruleset in VyOS 1.3 this was done by converting the 1.2 iptables ruleset to nftables and then do the diff. To convert from iptables to nftables use the following command: $ iptables-save -t nat > /tmp/tmp.iptables $ iptables-restore-translate -f /tmp/tmp.iptables The following CLI options have been used for testing: set nat destination rule 10 description 'foo-10' set nat destination rule 10 destination address '1.1.1.1' set nat destination rule 10 destination port '1111' set nat destination rule 10 exclude set nat destination rule 10 inbound-interface 'eth0.202' set nat destination rule 10 log set nat destination rule 10 protocol 'tcp_udp' set nat destination rule 10 translation address '192.0.2.10' set nat destination rule 15 description 'foo-10' set nat destination rule 15 destination address '1.1.1.1' set nat destination rule 15 exclude set nat destination rule 15 inbound-interface 'eth0.202' set nat destination rule 15 log set nat destination rule 15 protocol 'tcp_udp' set nat destination rule 15 translation address '192.0.2.10' set nat destination rule 20 description 'foo-20' set nat destination rule 20 destination address '2.2.2.2' set nat destination rule 20 inbound-interface 'eth0.201' set nat destination rule 20 log set nat destination rule 20 protocol 'tcp' set nat destination rule 20 translation address '192.0.2.10' --- src/conf_mode/nat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/conf_mode/nat.py b/src/conf_mode/nat.py index 4d739068f..13edca846 100755 --- a/src/conf_mode/nat.py +++ b/src/conf_mode/nat.py @@ -94,7 +94,7 @@ def parse_source_destination(conf, source_dest): 'description': '', 'dest_address': '', 'dest_port': '', - 'disable': False, + 'disabled': False, 'exclude': False, 'interface_in': '', 'interface_out': '', @@ -118,7 +118,7 @@ def parse_source_destination(conf, source_dest): rule['dest_port'] = conf.return_value(['destination', 'port']) if conf.exists(['disable']): - rule['disable'] = True + rule['disabled'] = True if conf.exists(['exclude']): rule['exclude'] = True -- cgit v1.2.3