I am trying to add a rule to my iptables, so that traffic trying to connect on port 9091 is forwarded to a different IP address. When searching I found this answer, which seems to fit my exact use case. When adopting the rule shown with my IP addresses and ports it looks like:
iptables -t nat -A PREROUTING -d 192.168.0.54 -p tcp --dport 9091 -j DNAT --to-destination 192.168.0.53
But when running I get the error:
iptables -t nat -A PREROUTING -d 192.168.0.54 -p tcp --dport 9091 -j DNAT --to-destination 192.168.0.53
iptables v1.8.7 (nf_tables): unknown option "--dport"
Try `iptables -h' or 'iptables --help' for more information.
I am not sure what's going on, everywhere I look, it says you have to make sure to specify a protocol before using the --dport option, but I am clearly specifying tcp. Any help would be appreciated.