louie miranda wrote:
I have an internel ftp server w/c i want to access over my linux router(gw) Its internel IP is 10.0.0.11 and port 21. My externel IP lets say 203.100.100.1.
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -A FORWARD -d 10.0.0.11 -j ACCEPT
iptables -A FORWARD -s 10.0.0.11 -j ACCEPT
iptables -A PREROUTING -t nat -p tcp -d 203.100.100.1 --dport 21 -j DNAT --to 10.0.0.11
ptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 203.100.100.1
tha should work: it's working for me, at least.
Remember that forwarded traffic must be SNATed with the source (public) address of the forwarding box.
andrea