Fixing duplicated and complex postrouting firewall rules in containers

This commit is contained in:
2022-03-10 21:36:22 +00:00
parent 5f5ca07582
commit 853d1e6d75

View File

@@ -76,7 +76,7 @@ prerouting() {
} }
postrouting() { postrouting() {
LINES=$($IPTABLES -L --line-number -n | grep $COMMENT | grep $TARGET_IP | grep MASQUERADE | awk '{print $1}'| tac) LINES=$($IPTABLES -L --line-number -n | grep $COMMENT | grep $TARGET_IP | grep $TARGET_PORT | awk '{print $1}'| tac)
debug "Previous postrouting lines: "$LINES debug "Previous postrouting lines: "$LINES
# DELETE UNECESSARY LINES FROM PREVIOUS RULES # DELETE UNECESSARY LINES FROM PREVIOUS RULES