I am trying to set up port forwarding with iptables.
I've read several stuff (including here on serverfault) but every example I try fails.
I have a Debian GNU/Linux box with a globally routed IP address, say 18.104.22.168. I also have an internal network 192.168.15.0/24, which has one host (192.168.15.2) in it.
I simply want port 2200 on 22.214.171.124 forwarded to 192.168.15.2:22, so this is what I've done:
iptables -A PREROUTING -t nat -p tcp --dport 2200 -j DNAT --to 192.168.15.2:22 iptables -A INPUT -p tcp -m state --state NEW --dport 2200 -j ACCEPT
However, this does not work. If i try to ssh to
126.96.36.199:2200, I get "Connection refused".
Trying for over 3hrs now and I'm feeling like I've tried everything and there must be something wrong.
IP forwarding is on:
email@example.com:~# cat /proc/sys/net/ipv4/ip_forward 1