Setting prerouting and postrouting rules in one process

This commit is contained in:
2022-05-19 05:29:56 +00:00
parent dd0ffa2d56
commit abe47c7622

View File

@@ -183,16 +183,14 @@ if [[ "$PREROUTING" == "true" ]] || [[ "$POSTROUTING" == "true" ]] || [[ "$HOST"
IPTABLES="/sbin/iptables -t nat";
else
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;
elif [[ "$POSTROUTING" == "true" ]] ; then
postrouting;
if [[ "$POSTROUTING" == "true" ]] ; then
postrouting;
fi
fi;
else