Added external IP to port forwarding.

master
bbruns 2010-08-26 21:51:47 +00:00
parent 5a3e6086b0
commit eb9d30aad8
1 changed files with 1 additions and 1 deletions

View File

@ -334,7 +334,7 @@ if [ $PORTFW ] && [ $NAT ]; then
for i in `grep -v "\#" $PORTFW`; do for i in `grep -v "\#" $PORTFW`; do
PORTADD=( ${i//:/ } ) PORTADD=( ${i//:/ } )
$IPTABLES -A PREROUTING -t nat -i ${PORTADD[0]} -p ${PORTADD[3]} \ $IPTABLES -A PREROUTING -t nat -i ${PORTADD[0]} -p ${PORTADD[3]} \
--dport ${PORTADD[2]} -d {PORTADD[1]} -j DNAT --to \ --dport ${PORTADD[2]} -d ${PORTADD[1]} -j DNAT --to \
${PORTADD[4]}:${PORTADD[5]} ${PORTADD[4]}:${PORTADD[5]}
$IPTABLES -A INPUT -p ${PORTADD[3]} -m state --state NEW \ $IPTABLES -A INPUT -p ${PORTADD[3]} -m state --state NEW \
--dport ${PORTADD[2]} -i ${PORTADD[0]} -j ACCEPT --dport ${PORTADD[2]} -i ${PORTADD[0]} -j ACCEPT