To reproduce, set nat configuration with incorrect port-range
set nat destination rule 120 destination address '203.0.113.1' set nat destination rule 120 destination port 21-18 set nat destination rule 120 inbound-interface 'eth0' set nat destination rule 120 protocol 'tcp' set nat destination rule 120 translation address '192.0.2.40'
Commit:
vyos@r11-roll# commit [ nat ] VyOS had an issue completing a command. Report time: 2022-01-04 14:04:08 Image version: VyOS 1.4-rolling-202201020317 Release train: sagitta Built by: [email protected] Built on: Sun 02 Jan 2022 03:17 UTC Build UUID: 4ede964a-6099-4799-b36e-a22a6b9a1914 Build commit ID: e933c7e50fd4f0 Architecture: x86_64 Boot via: installed image System type: KVM guest Hardware vendor: QEMU Hardware model: Standard PC (Q35 + ICH9, 2009) Hardware S/N: Hardware UUID: 8e21d64e-e498-475c-9866-290cd53a3b86 Traceback (most recent call last): File "/usr/libexec/vyos/conf_mode/nat.py", line 199, in <module> apply(c) File "/usr/libexec/vyos/conf_mode/nat.py", line 187, in apply cmd(f'{nftables_nat_config}') File "/usr/lib/python3/dist-packages/vyos/util.py", line 161, in cmd raise OSError(code, feedback) PermissionError: [Errno 1] failed to run command: /tmp/vyos-nat-rules.nft returned: exit code: 1 noteworthy: cmd '/tmp/vyos-nat-rules.nft' returned (out): returned (err): /tmp/vyos-nat-rules.nft:11:92-96: Error: Range has zero or negative size add rule ip nat PREROUTING iifname "eth0" ip protocol tcp ip daddr 203.0.113.1 tcp dport { 21-18 } counter dnat to 192.0.2.40 comment "DST-NAT-120" ^^^^^ [[nat]] failed Commit failed [edit] vyos@r11-roll#
Also, it allows to set port out of the port-range:
vyos@r11-roll# set nat destination rule 120 destination port 70000