iptables port forwarding: Unknown arg

709 Views Asked by At

I am trying to do port forwarding with iptables

I am having the problem 'Unknown arg `--to-destination' when trying to execute this command

iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j DNAT --to 192.168.1.2:80

Any ideas ?

1

There are 1 best solutions below

0
On

You can redirect the traffic?

If yes on prerouting use -j REDIRECT --to 192.168.1.2:80 If no Sorry.