mirror of
https://github.com/bol-van/zapret.git
synced 2025-12-30 19:38:08 +03:00
custom examples: refactor to use port overrides
This commit is contained in:
@@ -28,7 +28,7 @@ zapret_custom_firewall()
|
||||
|
||||
zapret_do_firewall_rules_ipt $1
|
||||
|
||||
f="-p udp --dport 443"
|
||||
f="-p udp -m multiport --dports $QUIC_PORTS_IPT"
|
||||
fw_nfqws_post $1 "$f $desync $first_packets_only" "$f $desync $first_packets_only" $QNUM2
|
||||
|
||||
}
|
||||
@@ -43,6 +43,6 @@ zapret_custom_firewall_nft()
|
||||
|
||||
zapret_apply_firewall_rules_nft
|
||||
|
||||
f="udp dport 443"
|
||||
f="udp dport {$QUIC_PORTS}"
|
||||
nft_fw_nfqws_post "$f $desync $first_packets_only" "$f $desync $first_packets_only" $QNUM2
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ zapret_custom_firewall()
|
||||
|
||||
zapret_do_firewall_rules_ipt $1
|
||||
|
||||
f="-p udp --dport 443"
|
||||
f="-p udp -m multiport --dports $QUIC_PORTS_IPT"
|
||||
fw_nfqws_post $1 "$f $desync $first_packets_only" "$f $desync $first_packets_only" $QNUM2
|
||||
# this for ipv4 only. do not have access to ipv6 enabled TSPU to test
|
||||
fw_nfqws_post $1 "$f $desync $udplen $short_header4" "" $QNUM3
|
||||
@@ -56,7 +56,7 @@ zapret_custom_firewall_nft()
|
||||
|
||||
zapret_apply_firewall_rules_nft
|
||||
|
||||
f="udp dport 443"
|
||||
f="udp dport {$QUIC_PORTS}"
|
||||
nft_fw_nfqws_post "$f $desync $first_packets_only" "$f $desync $first_packets_only" $QNUM2
|
||||
# this for ipv4 only. do not have access to ipv6 enabled TSPU to test
|
||||
nft_fw_nfqws_post "$f $desync $udplen $short_header4" "" $QNUM3
|
||||
|
||||
@@ -28,14 +28,14 @@ zapret_custom_firewall()
|
||||
local desync="-m mark ! --mark $DESYNC_MARK/$DESYNC_MARK"
|
||||
|
||||
[ "$MODE_HTTP" = "1" ] && {
|
||||
f4="-p tcp --dport 80"
|
||||
f4="-p tcp -m multiport --dports $HTTP_PORTS_IPT"
|
||||
f6=$f4
|
||||
filter_apply_ipset_target f4 f6
|
||||
fw_tpws $1 "$f4" "$f6" $TPPORT
|
||||
}
|
||||
|
||||
[ "$MODE_HTTPS" = "1" ] && {
|
||||
f4="-p tcp --dport 443 $first_packet_only"
|
||||
f4="-p tcp -m multiport --dports $HTTPS_PORTS_IPT $first_packet_only"
|
||||
f6=$f4
|
||||
filter_apply_ipset_target f4 f6
|
||||
fw_nfqws_post $1 "$f4 $desync" "$f6 $desync" $QNUM
|
||||
@@ -50,14 +50,14 @@ zapret_custom_firewall_nft()
|
||||
local desync="mark and $DESYNC_MARK == 0"
|
||||
|
||||
[ "$MODE_HTTP" = "1" ] && {
|
||||
f4="tcp dport 80"
|
||||
f4="tcp dport {$HTTP_PORTS}"
|
||||
f6=$f4
|
||||
nft_filter_apply_ipset_target f4 f6
|
||||
nft_fw_tpws "$f4" "$f6" $TPPORT
|
||||
}
|
||||
|
||||
[ "$MODE_HTTPS" = "1" ] && {
|
||||
f4="tcp dport 443 $first_packet_only"
|
||||
f4="tcp dport {$HTTPS_PORTS} $first_packet_only"
|
||||
f6=$f4
|
||||
nft_filter_apply_ipset_target f4 f6
|
||||
nft_fw_nfqws_post "$f4 $desync" "$f6 $desync" $QNUM
|
||||
|
||||
Reference in New Issue
Block a user