mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-29 21:40:52 +03:00
Compare commits
2 Commits
1b14a8210c
...
09378553b9
Author | SHA1 | Date | |
---|---|---|---|
|
09378553b9 | ||
|
6b85884cdf |
@ -8,12 +8,15 @@ zapret_custom_firewall()
|
|||||||
{
|
{
|
||||||
# $1 - 1 - add, 0 - stop
|
# $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.
|
[ "$DISABLE_IPV4" = "1" ] || {
|
||||||
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)}
|
# use IFACE_WAN if defined. if not - search for interfaces with default route.
|
||||||
for wan in $wanif; do
|
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)}
|
||||||
ipt_print_op $1 "-o $wan -j MASQUERADE" "keenetic udp fix"
|
for wan in $wanif; do
|
||||||
ipt_add_del $1 POSTROUTING -t nat -o $wan -j MASQUERADE
|
rule="-o $wan -p udp -m mark --mark $DESYNC_MARK/$DESYNC_MARK"
|
||||||
done
|
ipt_print_op $1 "$rule" "keenetic udp fix"
|
||||||
|
ipt_add_del $1 POSTROUTING -t nat $rule -j MASQUERADE
|
||||||
|
done
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user