Setting prerouting and postrouting rules in one process
This commit is contained in:
@@ -183,16 +183,14 @@ if [[ "$PREROUTING" == "true" ]] || [[ "$POSTROUTING" == "true" ]] || [[ "$HOST"
|
|||||||
IPTABLES="/sbin/iptables -t nat";
|
IPTABLES="/sbin/iptables -t nat";
|
||||||
else
|
else
|
||||||
IPTABLES="nsenter -t $(docker inspect --format {{.State.Pid}} $NAME) -n -- $IPTABLES -t nat";
|
IPTABLES="nsenter -t $(docker inspect --format {{.State.Pid}} $NAME) -n -- $IPTABLES -t nat";
|
||||||
fi
|
|
||||||
|
|
||||||
debug "iptables: "$IPTABLES;
|
debug "iptables: "$IPTABLES;
|
||||||
|
|
||||||
if [[ "$PREROUTING" == "true" ]] ; then
|
|
||||||
prerouting;
|
prerouting;
|
||||||
|
|
||||||
elif [[ "$POSTROUTING" == "true" ]] ; then
|
if [[ "$POSTROUTING" == "true" ]] ; then
|
||||||
postrouting;
|
postrouting;
|
||||||
|
fi
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user