Introduced SOURCE_IFACE variable
This commit is contained in:
@@ -151,7 +151,8 @@ if [[ -z "$SOURCE_IP" ]]; then
|
|||||||
if [[ -z "$SOURCE" ]]; then
|
if [[ -z "$SOURCE" ]]; then
|
||||||
#SOURCE_IP="0.0.0.0/0";
|
#SOURCE_IP="0.0.0.0/0";
|
||||||
echo "No source IP added";
|
echo "No source IP added";
|
||||||
elif [ "$SOURCE" == "SOURCE_IFACE" ]; then
|
elif [ "$(set | grep -w SOURCE_IFACE)" != "" ]; then
|
||||||
|
SOURCE=$SOURCE_IFACE;
|
||||||
echo "VPN interface added instead of IP or domain name";
|
echo "VPN interface added instead of IP or domain name";
|
||||||
else
|
else
|
||||||
IDX=0
|
IDX=0
|
||||||
@@ -246,7 +247,7 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
prerouting() {
|
prerouting() {
|
||||||
if [ "$SOURCE" == "SOURCE_IFACE" ]; then
|
if [ "$(set |grep -w SOURCE_IFACE)" != "" ]; 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
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user