Iptables not forwaring to another ip
I have 2 Linux boxes one acting as a router with a direct connection to the internet, second as a server using the first box as a gateway to the internet.
I need to forward requests that I get from the outside to port 8400 to my internal server box at 192.168.0.7:8400
Router IP 192.168.0.5
Server IP 192.168.0.7
iptables -t nat -A PREROUTING -p tcp -d [internet ip] --dport 8400 -j DNAT --to-destination 192.168.0.7:8400 < Won't work
iptables -t nat -A PREROUTING -p tcp -d [internet ip] --dport 8400 -j DNAT --to-destination 192.168.0.5:8400 < Will work
These rules are on the router (192.168.0.5)
I've been trying to find a solution for hours with no success.
Basically the problem is I can forward ports on the same box but not to a different ip..
Any help would be greatly appreciated.
|