I'm trying to run the following commmand on my Raspbian system
sudo iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 2222 -j DNAT --to-destination 192.168.2.241:22
iptables says:
iptables v1.8.2 (nf_tables): unknown option "--to-destination"
Try `iptables -h' or 'iptables --help' for more information.
Same issue if I change --to-destination
to --to
.
I'm fairly new to iptables
etc, and I haven't been able to track down the issue with internet search.
I understand that at some point iptables
is changing into "nf_tables"? Has this already happened in Raspbian? Is that the source of my problem?
That exact command works on my RPi with Raspbian 10 Buster.
Perhaps you've got a corrupted installation with some missing files? Or some non-standard settings?
Replace the SD card with a fresh new Raspbian system and try again. It should work, the command is correct.