Added external IP to port forwarding.
parent
5a3e6086b0
commit
eb9d30aad8
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue