Replies: 1 comment
-
经过一凡调查明白了,在 mangle table PREROUTING chain 里面对流量做了 mark,所以这里劫持 tcp 53 不让它 redirect 到本地的 53 而是继续走到 nat table FORWARD chain 进入 tun |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
OpenClash v0.45.35-212
TUN 模式下,会自动添加一条 iptables 规则
iptables -t nat -I PREROUTING -m comment --comment "OpenClash TCP DNS Hijack" -p tcp --dport 53 -j ACCEPT
在同时开启的本地DNS劫持的时候,最终在 nat table 的 prerouting chain 生成的规则如下:
pkts bytes target prot opt in out source destination
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 /* OpenClash TCP DNS Hijack / tcp dpt:53
0 0 REDIRECT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:53 / OpenClash DNS Hijack / redir ports 53
599 38746 REDIRECT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:53 / OpenClash DNS Hijack */ redir ports 53
不太理解第一条规则的含义,这样不是会造成所有 tcp 53 的请求直接放行而没有达到劫持目的吗?
Beta Was this translation helpful? Give feedback.
All reactions