Quote:
$IPTABLES -t nat -A PREROUTING -i $EXT_IF -p tcp --dport 41265 -j DNAT --to 192.168.1.37
|
Let's break this down so that you might understand why it's failing.
$IPTABLES -t nat -A PREROUTING
The above part of the command selects the PREROUTING entry from the nat table.
-i $EXT_IF
using the interface defined by $EXT_IF
-p tcp --dport 41265
directed at the TCP port 41265
-j DNAT --to 192.168.1.37
take this connection and DNAT it to the IP specified.
You'll notice, you haven't done any -s or -d flags(source and destination), so my question to you is, how did you expect it to NOT forward everyone to that port? Try something like:
$IPTABLES -t nat -A PREROUTING -p tcp --dport 41265 -s $ALLOWED_IP -i $EXT_IF -j DNAT --to $DESTINATION_IP:41265
and substitute as many entries as you think you'll need for $ALLOWED_IP