From 6b85884cdf45f50e36a4cf4a5848a4a3e025d78f Mon Sep 17 00:00:00 2001 From: bol-van Date: Thu, 21 Nov 2024 20:30:23 +0300 Subject: [PATCH] update keentic fix script --- init.d/sysv/custom.d.examples/10-keenetic-udp-fix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/init.d/sysv/custom.d.examples/10-keenetic-udp-fix b/init.d/sysv/custom.d.examples/10-keenetic-udp-fix index e04706c..554e6fb 100644 --- a/init.d/sysv/custom.d.examples/10-keenetic-udp-fix +++ b/init.d/sysv/custom.d.examples/10-keenetic-udp-fix @@ -8,12 +8,13 @@ zapret_custom_firewall() { # $1 - 1 - add, 0 - stop - local wan wanif + local wan wanif rule # use IFACE_WAN if defined. if not - search for interfaces with default route. wanif=${IFACE_WAN:-$(sed -nre 's/^([^\t]+)\t00000000\t[0-9A-F]{8}\t[0-9A-F]{4}\t[0-9]+\t[0-9]+\t[0-9]+\t00000000.*$/\1/p' /proc/net/route | sort -u | xargs)} for wan in $wanif; do - ipt_print_op $1 "-o $wan -j MASQUERADE" "keenetic udp fix" - ipt_add_del $1 POSTROUTING -t nat -o $wan -j MASQUERADE + rule="-o $wan -p udp -m mark --mark $DESYNC_MARK/$DESYNC_MARK" + ipt_print_op $1 "$rule" "keenetic udp fix" + ipt_add_del $1 POSTROUTING -t nat $rule -j MASQUERADE done }