Iptables Port forwarding
Hello,
I have set a rule in Iptables to do port forwarding to another Ip in /sbin/iptables -t nat -A PREROUTING -p tcp -i eth+ -d 192.168.2.10 --dport 2200 -j DNAT --to 192.168.70.101:2200 /sbin/iptables -A FORWARD -p tcp -i eth1 -d 192.168.70.101 --dport 2200 -j ACCEPT The redirect rule is working fine from other PC's but I am not able to do the same from the same machine in which I have configured the IPtables rule ie: telnet localhost 2200 not working and also telnet 192.168.2.10 2200 not working from the machine whereas it redirection is working from from other PC's |
Quote:
|
Hello,
Thank you for your reply, the Gateway for the PC and the IPtables Machine are the same. as I told redirection is working fine if I try from another machine. but I am not abke to do the same from the IPtables machine using localhost or the IP it tells connection refused. 0.0.0.0 192.168.2.1 0.0.0.0 UG 100 0 0 eth0 |
Quote:
Have a look at this post http://www.linuxquestions.org/questi...-issue-487153/ In essence, you need the following Code:
iptables -t nat -A OUTPUT -p tcp --dport 2200 -j DNAT --to 192.168.70.101 |
Hello,
I did check that before but was not working for me... but when I tried now it worked... had to flush Iptables two time, to get this worked.. iptables -t nat -F iptables -F Thank you. |
All times are GMT -5. The time now is 11:02 AM. |