Port Forwarding using iptables-DNAT
I am using a linux box (Linux 2.4.19-pre2-rmap12g) as a NAT/Server. I don't really know much about linux and the configuration has been done by somebody else (from my ISP), and it is using 'iptables'. I want to start using a file-sharing program on a Windows box that is behind the NAT and has a private ip, so i have documented about 'port forwarding using DNAT', and i found what i needed. This is the command I used: ' iptables -t nat -A PREROUTING -p tcp -i eth0 -d xxx.xxx.xxx.xxx --dport 81 -j DNAT --to 192.168.0.2:80 ' . ( xxx.xxx.xxx.xxx is the public IP address of the Linux box(NAT) ) . I opened a web-server on the .2 box , and tried to access xxx.xxx.xxx.xxx:81 and it did not work. I did ' iptables -t nat -L' and everything seemed ok. Why dose it not work ?
PS. Remember that I do not know much about Linux/iptables, for example I know that '-t nat' makes a reffernece to the < "nat" table > but I don't know what that is, or if it must be created at first...
|