Check TARGET IP and TARGET PORT exist
This commit is contained in:
@@ -248,9 +248,10 @@ fi
|
|||||||
|
|
||||||
prerouting() {
|
prerouting() {
|
||||||
if [ "$(set |grep -w SOURCE_IFACE)" != "" ]; then
|
if [ "$(set |grep -w SOURCE_IFACE)" != "" ]; then
|
||||||
|
if [ "$TARGET_IP" != "" ] && [ "$TARGET_PORT" != "" ] ; then
|
||||||
debug "$IPTABLES -I PREROUTING -i $SOURCE_IFACE -p $PROTOCOL --dport $SOURCE_PORT -m comment --comment $COMMENT -j DNAT --to $TARGET_IP:$TARGET_PORT"
|
debug "$IPTABLES -I PREROUTING -i $SOURCE_IFACE -p $PROTOCOL --dport $SOURCE_PORT -m comment --comment $COMMENT -j DNAT --to $TARGET_IP:$TARGET_PORT"
|
||||||
$IPTABLES -w -I PREROUTING -i $SOURCE_IFACE -p $PROTOCOL --dport $SOURCE_PORT -m comment --comment "$COMMENT" -j DNAT --to $TARGET_IP:$TARGET_PORT
|
$IPTABLES -w -I PREROUTING -i $SOURCE_IFACE -p $PROTOCOL --dport $SOURCE_PORT -m comment --comment "$COMMENT" -j DNAT --to $TARGET_IP:$TARGET_PORT
|
||||||
|
fi
|
||||||
elif [ "$SOURCE_IP" != "" ]; then
|
elif [ "$SOURCE_IP" != "" ]; then
|
||||||
if [ "$SOURCE_PORT" != "" ]; then
|
if [ "$SOURCE_PORT" != "" ]; then
|
||||||
if [ "$TARGET_IP" != "" ]; then
|
if [ "$TARGET_IP" != "" ]; then
|
||||||
|
Reference in New Issue
Block a user