SNAT and DNAT on same firewall machine not working
I shared my internet connection by -
iptables -F
iptables -t nat -F
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
Where eth0 is the internet connected nic and eth1 is the LAN nic.
Internet connection sharing is working fine.
Now I want to use DNAT on my static ip and redirect all trafic on port 1433 (ms-sql-s) to 192.168.127.1
I tried the following iptables statement -
iptables -t nat -A PREROUTING --dst XXX.XXX.XXX.XXX -p tcp --dport 1433 -j DNAT --to-destination 192.168.127.1
But it is not working.
Can anyone help.
|