Fixed AWG scripts
This commit is contained in:
@@ -276,9 +276,13 @@ data:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FIRST_FORWARD_RULE="$("${IPTABLES[@]}" -S FORWARD | grep '^-A FORWARD ' | sed -n '1p')"
|
# The amneziawg FORWARD jump must be present. firewall-up inserts it at
|
||||||
[[ "${FIRST_FORWARD_RULE}" == *"--comment amneziawg-forward-jump"* ]]
|
# position 1, but CNI controllers (e.g. kube-router) legitimately re-assert
|
||||||
[[ "${FIRST_FORWARD_RULE}" == *"-j ${FORWARD_CHAIN}"* ]]
|
# their own jump ahead of it. Requiring the strict first position makes the
|
||||||
|
# readiness probe flap as the two fight over rule order. Isolation still holds
|
||||||
|
# as long as the jump is traversed and no earlier rule accepts awg0-to-awg0
|
||||||
|
# traffic (kube-router's chain returns non-pod traffic without a decision).
|
||||||
|
"${IPTABLES[@]}" -C FORWARD -m comment --comment amneziawg-forward-jump -j "${FORWARD_CHAIN}"
|
||||||
ACTIVE_POLICY="$("${IPTABLES[@]}" -S "${FORWARD_CHAIN}" 2>/dev/null \
|
ACTIVE_POLICY="$("${IPTABLES[@]}" -S "${FORWARD_CHAIN}" 2>/dev/null \
|
||||||
| awk '$1 == "-A" && $3 == "-j" && $4 ~ /^AMNEZIAWG-POLICY-[AB]$/ { print $4; exit }')"
|
| awk '$1 == "-A" && $3 == "-j" && $4 ~ /^AMNEZIAWG-POLICY-[AB]$/ { print $4; exit }')"
|
||||||
[ -n "${ACTIVE_POLICY}" ]
|
[ -n "${ACTIVE_POLICY}" ]
|
||||||
|
|||||||
Reference in New Issue
Block a user