I have an ubuntu server (14.04.1) which is asking as a router for my network. It has an internet facing interface, eth0, and a second interface, eth1, for connecting to my 10.0.0.0 network.
I am attempting to forward TCP traffic directed to eth0 (for this example, lets say its IP is 188.8.131.52) to eth1 with an address of 10.0.0.1 for port 27016
I have attempted the following commands in sequence:
sudo echo "1" > /proc/sys/net/ipv4/ip_forward
sudo sysctl net.ipv4.ip_forward=1
sudo iptables -t nat -A PREROUTING -p tcp --dport 27016 -j DNAT --to-destination 10.0.0.104:27016
sudo iptables -t nat -A POSTROUTING -j MASQUERADE
but this doesnt seem to work at all, i cannot connect to 184.108.40.206:27016 to access the application running on 10.0.0.104:27016. Is it to do with it being across two interfaces or what?