vernesong / OpenClash

A Clash Client For OpenWrt
MIT License
16.79k stars 3.09k forks source link

[Feature] 希望添加关闭劫持局域网53端口的开关 #3980

Closed YuxuanZuo closed 1 month ago

YuxuanZuo commented 1 month ago

Verify Steps

Describe the Feature

在Fake-IP模式且开启绕过中国大陆的情况下,DNS劫持设置为dnsmsaq上游或停用时仍然会劫持局域网53端口,这会导致路由器部署wireguard时无法绕过代理。 经过定位,这一问题的原因可能由此处的代码导致: https://github.com/vernesong/OpenClash/blob/dd5e07d891f12ab46830db4064f7a0e19a08f38d/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh#L95-L102

Describe Alternatives

请问是否可以添加一个默认开启的开关来控制这个行为?

sqliuchang commented 1 month ago

巧了,前一阵子玩校园网免流也遇到了这个问题,会导致无法将53端口的流量转发到wg的监听端口,个人是修改 https://github.com/vernesong/OpenClash/blob/a2ec35894484426ecc80ef1fec940ca28b43c0bc/luci-app-openclash/root/etc/init.d/openclash#L1614 这附近为


nft insert rule inet fw4 dstnat position 0 udp dport 53 ${ACBLACKDNSFILTER} ip saddr ${lan_ip}/24 counter redirect to "$DNSPORT" comment \"OpenClash DNS Hijack\"