mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-02 08:13:56 +08:00
update 2026-09-02 23:49:44
This commit is contained in:
1 parent
86b8972e8e
commit
beae9d285e
1991 files changed
+1523711
-147
No files matched your search
@@ -560,8 +560,6 @@ load_acl() {
|
||||
msg="【默认】,"
|
||||
local ipt_tmp=$ipt_n
|
||||
[ -n "${is_tproxy}" ] && ipt_tmp=$ipt_m
|
||||
local DEFAULT_TCP_REDIR=1
|
||||
local DEFAULT_UDP_REDIR=1
|
||||
|
||||
[ "$TCP_NO_REDIR_PORTS" != "disable" ] && {
|
||||
add_port_rules "$ip6t_m -A PSW $(comment "默认") -p tcp" $TCP_NO_REDIR_PORTS "-j RETURN"
|
||||
@@ -570,7 +568,6 @@ load_acl() {
|
||||
echolog " - ${msg}不代理 TCP 端口[${TCP_NO_REDIR_PORTS}]"
|
||||
else
|
||||
unset TCP_PROXY_MODE
|
||||
DEFAULT_TCP_REDIR=0
|
||||
echolog " - ${msg}不代理所有 TCP 端口"
|
||||
fi
|
||||
}
|
||||
@@ -582,7 +579,6 @@ load_acl() {
|
||||
echolog " - ${msg}不代理 UDP 端口[${UDP_NO_REDIR_PORTS}]"
|
||||
else
|
||||
unset UDP_PROXY_MODE
|
||||
DEFAULT_UDP_REDIR=0
|
||||
echolog " - ${msg}不代理所有 UDP 端口"
|
||||
fi
|
||||
}
|
||||
@@ -630,9 +626,6 @@ load_acl() {
|
||||
[ "${USE_SHUNT_NODE}" = "1" ] && add_port_rules "$ipt_m -A PSW $(comment "默认") -p tcp" $TCP_PROXY_DROP_PORTS $(dst $IPSET_SHUNT) "-j MARK --set-mark 88"
|
||||
[ "${TCP_PROXY_MODE}" != "disable" ] && add_port_rules "$ipt_m -A PSW $(comment "默认") -p tcp" $TCP_PROXY_DROP_PORTS "-j MARK --set-mark 88"
|
||||
echolog " - ${msg}屏蔽代理 TCP 端口[${TCP_PROXY_DROP_PORTS}]"
|
||||
if has_1_65535 "$TCP_PROXY_DROP_PORTS"; then
|
||||
DEFAULT_TCP_REDIR=0
|
||||
fi
|
||||
}
|
||||
|
||||
[ "$UDP_PROXY_DROP_PORTS" != "disable" ] && {
|
||||
@@ -651,9 +644,6 @@ load_acl() {
|
||||
[ "${USE_SHUNT_NODE}" = "1" ] && add_port_rules "$ipt_m -A PSW $(comment "默认") -p udp" $UDP_PROXY_DROP_PORTS "$(dst $IPSET_SHUNT) -j MARK --set-mark 88"
|
||||
[ "${UDP_PROXY_MODE}" != "disable" ] && add_port_rules "$ipt_m -A PSW $(comment "默认") -p udp" $UDP_PROXY_DROP_PORTS "-j MARK --set-mark 88"
|
||||
echolog " - ${msg}屏蔽代理 UDP 端口[${UDP_PROXY_DROP_PORTS}]"
|
||||
if has_1_65535 "$UDP_PROXY_DROP_PORTS"; then
|
||||
DEFAULT_UDP_REDIR=0
|
||||
fi
|
||||
}
|
||||
|
||||
$ipt_m -A PSW $(comment "默认") -m mark --mark 88 -j ACCEPT 2>/dev/null
|
||||
@@ -662,9 +652,6 @@ load_acl() {
|
||||
}
|
||||
}
|
||||
|
||||
set_cache_var "DEFAULT_TCP_REDIR" "$DEFAULT_TCP_REDIR"
|
||||
set_cache_var "DEFAULT_UDP_REDIR" "$DEFAULT_UDP_REDIR"
|
||||
|
||||
# 加载TCP默认代理模式
|
||||
if [ -n "${TCP_PROXY_MODE}" ]; then
|
||||
[ -n "$NODE" ] && {
|
||||
@@ -995,7 +982,7 @@ add_firewall_rule() {
|
||||
echolog " - [$?]解析并加入[分流节点] GeoIP 到 IPSET 完成"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
get_local_ips ip4 | sed "s/^/add $IPSET_LOCAL /" | ipset -! -R
|
||||
get_local_ips ip6 | sed "s/^/add $IPSET_LOCAL6 /" | ipset -! -R
|
||||
|
||||
@@ -1198,7 +1185,7 @@ add_firewall_rule() {
|
||||
else
|
||||
ipt_j="$(REDIRECT $REDIR_PORT)"
|
||||
fi
|
||||
|
||||
|
||||
msg="【路由器本机】,"
|
||||
[ "$TCP_NO_REDIR_PORTS" != "disable" ] && {
|
||||
add_port_rules "$ipt_tmp -A PSW_OUTPUT -p tcp" $TCP_NO_REDIR_PORTS "-j RETURN"
|
||||
@@ -1210,7 +1197,7 @@ add_firewall_rule() {
|
||||
echolog " - ${msg}不代理所有 TCP 端口"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
[ "$UDP_NO_REDIR_PORTS" != "disable" ] && {
|
||||
add_port_rules "$ipt_m -A PSW_OUTPUT -p udp" $UDP_NO_REDIR_PORTS "-j RETURN"
|
||||
add_port_rules "$ip6t_m -A PSW_OUTPUT -p udp" $UDP_NO_REDIR_PORTS "-j RETURN"
|
||||
@@ -1241,7 +1228,7 @@ add_firewall_rule() {
|
||||
[ "${LOCALHOST_TCP_PROXY_MODE}" != "disable" ] && add_port_rules "$ipt_m -A PSW_OUTPUT -p tcp" $TCP_PROXY_DROP_PORTS "-j MARK --set-mark 88"
|
||||
echolog " - ${msg}屏蔽代理 TCP 端口[${TCP_PROXY_DROP_PORTS}]"
|
||||
}
|
||||
|
||||
|
||||
[ "$UDP_PROXY_DROP_PORTS" != "disable" ] && {
|
||||
[ "${USE_FAKEDNS}" = "1" ] && add_port_rules "$ipt_m -A PSW_OUTPUT -p udp" $UDP_PROXY_DROP_PORTS "-d $FAKE_IP -j MARK --set-mark 88"
|
||||
[ "${USE_PROXY_LIST}" = "1" ] && add_port_rules "$ipt_m -A PSW_OUTPUT -p udp" $UDP_PROXY_DROP_PORTS "$(dst $IPSET_BLACK) -j MARK --set-mark 88"
|
||||
@@ -1387,7 +1374,7 @@ add_firewall_rule() {
|
||||
|
||||
$ipt_m -I OUTPUT $(comment "mangle-OUTPUT-PSW") -o lo -j RETURN
|
||||
insert_rule_before "$ipt_m" "OUTPUT" "mwan3" "$(comment mangle-OUTPUT-PSW) -m mark --mark ${FWMARK} -j RETURN"
|
||||
|
||||
|
||||
$ip6t_m -I OUTPUT $(comment "mangle-OUTPUT-PSW") -o lo -j RETURN
|
||||
insert_rule_before "$ip6t_m" "OUTPUT" "mwan3" "$(comment mangle-OUTPUT-PSW) -m mark --mark ${FWMARK} -j RETURN"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user