Fixed AWG scripts
This commit is contained in:
@@ -96,12 +96,18 @@ data:
|
|||||||
[[ "${source}" == \#* ]] && continue
|
[[ "${source}" == \#* ]] && continue
|
||||||
if [ -n "${extra:-}" ] \
|
if [ -n "${extra:-}" ] \
|
||||||
|| ! valid_ipv4_32 "${source}" \
|
|| ! valid_ipv4_32 "${source}" \
|
||||||
|| ! valid_ipv4_32 "${destination:-}" \
|
|| ! valid_ipv4_32 "${destination:-}"; then
|
||||||
|| ! routed_through_awg0 "${source}" \
|
echo "Skipping malformed policy line: ${source:-} ${destination:-} ${extra:-}" >&2
|
||||||
|| ! routed_through_awg0 "${destination}"; then
|
continue
|
||||||
echo "Invalid or out-of-tunnel policy line: ${source:-} ${destination:-} ${extra:-}" >&2
|
fi
|
||||||
"${IPTABLES[@]}" -F "${inactive}"
|
# A pair whose endpoints are not (yet) routed through awg0 is skipped
|
||||||
return 1
|
# rather than fatal. During interface bring-up the awg0 route may not be
|
||||||
|
# in place, and a missing ACCEPT simply leaves the pair subject to the
|
||||||
|
# client-isolation DROP below (fail-closed) instead of aborting the whole
|
||||||
|
# policy and crash-looping the container.
|
||||||
|
if ! routed_through_awg0 "${source}" || ! routed_through_awg0 "${destination}"; then
|
||||||
|
echo "Skipping out-of-tunnel policy pair: ${source} ${destination}" >&2
|
||||||
|
continue
|
||||||
fi
|
fi
|
||||||
"${IPTABLES[@]}" -A "${inactive}" \
|
"${IPTABLES[@]}" -A "${inactive}" \
|
||||||
-i awg0 -o awg0 -s "${source}" -d "${destination}" \
|
-i awg0 -o awg0 -s "${source}" -d "${destination}" \
|
||||||
|
|||||||
Reference in New Issue
Block a user