Introduced SOURCE_IFACE variable
This commit is contained in:
@@ -150,7 +150,9 @@ fi;
|
|||||||
if [[ -z "$SOURCE_IP" ]]; then
|
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
|
||||||
|
echo "VPN interface added instead of IP or domain name";
|
||||||
else
|
else
|
||||||
IDX=0
|
IDX=0
|
||||||
for i in $(echo $SOURCE) ; do
|
for i in $(echo $SOURCE) ; do
|
||||||
@@ -244,7 +246,11 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
prerouting() {
|
prerouting() {
|
||||||
if [ "$SOURCE_IP" != "" ]; then
|
if [ "$SOURCE" == "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"
|
||||||
|
$IPTABLES -w -I PREROUTING -i $SOURCE_IFACE -p $PROTOCOL --dport $SOURCE_PORT -m comment --comment "$COMMENT" -j DNAT --to $TARGET_IP:$TARGET_PORT
|
||||||
|
|
||||||
|
elif [ "$SOURCE_IP" != "" ]; then
|
||||||
if [ "$SOURCE_PORT" != "" ]; then
|
if [ "$SOURCE_PORT" != "" ]; then
|
||||||
if [ "$TARGET_IP" != "" ]; then
|
if [ "$TARGET_IP" != "" ]; then
|
||||||
if [ "$TARGET_PORT" != "" ]; then
|
if [ "$TARGET_PORT" != "" ]; then
|
||||||
|
Reference in New Issue
Block a user