Quote:
Originally Posted by emmendes
I remember that there was a second line. Could it something like the following?
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 43022 -j DNAT --to
192.168.0.7 --dport 22
iptables -A FORWARD -p tcp --dport 43022 -j ACCEPT
Is the --dport 22 on the first line ok?
many thanks
Ed
|
No, you'd need to specify the new port by just putting it next to the IP, like:
Code:
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 43022 -j DNAT --to 192.168.0.7:22
As for the second line, replace it with something like:
Code:
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -p tcp --dport 43022 -m state --state NEW -j ACCEPT
Notice how the traffic direction was specified by use of the interface matches.