emel_punk wrotei need now to redirect a port from my eth1 (internet) to my client port 5901.
my client port 5901
--dport 4501
5900/tcp filtered vnc
First of all -- your request did not mention port 4501 or 5900, but your included code did! Please be specific with your request, as guessing games make it hard to help you out. For my examples I will only be using port 5901, but you can figure out how to substitute
--dport 4501 if you require it.
You forgot a few things with your code.
- With prerouting you didn't add '-d public.ip.of.vpnserver'. You will need that.
- With prerouting, --to is not the same as --to-destination. You should be using --to-destination instead.
- Also, you didn't apply a forward rule. You will need that too.
Copy the following two lines of code, and make changes as you will.
iptables -A FORWARD -p TCP -i eth1 -d 10.0.0.74 --dport 5901 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -d public.ip.of.vpnserver --dport 5901 -j DNAT --to-destination 10.0.0.74:5901