/etc/iptables/rule.v4 file contains many rule, the below is the line where I see the issue
-A INPUT -p tcp -m multiport --dports 22 -j ACCEPT -A INPUT -p udp -m multiport --dports 16384:32768 -j ACCEPT
When I tried to do
iptables-restore it failed with below error
root@rs-dal:/etc/iptables# iptables-restore rules.q iptables-restore v1.8.2 (nf_tables): multiport needs `-p tcp', `-p udp', `-p udplite', `-p sctp' or `-p dccp' Error occurred at line: 26 Try `iptables-restore -h' or 'iptables-restore --help' for more information. root@rs-dal:/etc/iptables#
why is it failing?, the same rule had worked successfully on
Also when I changed the rules like below, it worked.
-A INPUT -p tcp --dport 22 -j ACCEPT -A INPUT -p udp --dport 16384:32768 -j ACCEPT
I checked the
iptables -L and these rules applied successfully as below
ACCEPT udp -- anywhere anywhere udp dpts:16384:32768 ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
Whether the rule that I currently have is a valid syntax?
Below is my OS details
root@rs-dal:/etc/iptables# cat /etc/os-release PRETTY_NAME="Debian GNU/Linux buster/sid" NAME="Debian GNU/Linux" ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"