Skip to content

Commit

Permalink
fix: Fix mihomo dns forwarding condition judgment error
Browse files Browse the repository at this point in the history
  • Loading branch information
CHIZI-0618 committed Sep 16, 2024
1 parent 44e397d commit 3a20fd9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions box/scripts/box.tproxy
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ start_tproxy() {
# ${iptables} -t mangle -A BOX_EXTERNAL -p udp -m socket --transparent -j MARK --set-xmark ${mark_id}
# ${iptables} -t mangle -A BOX_EXTERNAL -m socket -j RETURN

if [ "${bin_name}" = "clash" ] || [ "${bin_name}" = "hysteria" ] || [ "${mihome_dns_forward}" = "true" ] ; then
if [ "${mihome_dns_forward}" = "true" ] && [ "${bin_name}" = "mihomo" ] || [ "${bin_name}" = "hysteria" ] || [ "${bin_name}" = "clash" ] ; then
${iptables} -t mangle -A BOX_EXTERNAL -p tcp --dport 53 -j RETURN
${iptables} -t mangle -A BOX_EXTERNAL -p udp --dport 53 -j RETURN
else
Expand Down Expand Up @@ -253,7 +253,7 @@ start_tproxy() {
log Info "${ignore_out_list[*]} ignore transparent proxy."
fi

if [ "${bin_name}" = "clash" ] || [ "${bin_name}" = "hysteria" ] || [ "${mihome_dns_forward}" = "true" ] ; then
if [ "${mihome_dns_forward}" = "true" ] && [ "${bin_name}" = "mihomo" ] || [ "${bin_name}" = "hysteria" ] || [ "${bin_name}" = "clash" ] ; then
${iptables} -t mangle -A BOX_LOCAL -p tcp --dport 53 -j RETURN
${iptables} -t mangle -A BOX_LOCAL -p udp --dport 53 -j RETURN
else
Expand Down Expand Up @@ -351,7 +351,7 @@ start_tproxy() {
fi


if [ "${bin_name}" = "clash" ] || [ "${mihome_dns_forward}" = "true" ] ; then
if [ "${mihome_dns_forward}" = "true" ] && [ "${bin_name}" = "mihomo" ] || [ "${bin_name}" = "clash" ] ; then
if [ "${iptables}" = "iptables -w 100" ] ; then
# android ip6tablses no nat table
${iptables} -t nat -N CLASH_DNS_EXTERNAL
Expand Down

0 comments on commit 3a20fd9

Please sign in to comment.