File tree Expand file tree Collapse file tree 8 files changed +648
-33
lines changed
Expand file tree Collapse file tree 8 files changed +648
-33
lines changed Original file line number Diff line number Diff line change @@ -24,23 +24,7 @@ Anywhere停止链接
2424anywhere://share/J2VP8X5qVhbI2sRvhZ2hdp4467QzpcHDlkAQil7Mg6oDOLdzYgAJO+9fKKenP2M28XWZ71jveGDq1E/sCmMAhBqd5N04LZkJp0EYtrFp7Vw9xPsYBhlmwlaKWljr9iIAMGWOulpW7Zzhm/tpfaDIKjweOGfIsONgcoWq89Idmb215WTrhfju+OeoNqDicBqrOLI5iyI8fTCQifRm7m7hq53WMgN/BoYbWnyE34AeVO2hq5btVggCTBGunrftXnlweSY4ngaN8CmhTlDWQeyjMJRZMooTPHwcQm3fisvBY6McMaVV5lSLHBe+MNaK1EwnzQ0RjNJh/3eoVGQJgUUyN8swAmtakrwaNA==
2525```
2626
27- # 原理
28- 本插件实现方法非常简单,利用了iptables进行流量转发,将53端口的流量转发到5591也就是本插件设置的AdGuardHome端口
29-
30- - apply_iptables.sh 片段
31- ``` sh
32- # 返回所有 AdGuardHome 的请求
33- iptables -t nat -A ADGUARD -m owner --uid-owner root --gid-owner net_admin -j RETURN
34- # 将 53 端口所有 udp tcp 流量转发到 adguard home
35- iptables -t nat -A ADGUARD -p udp --dport 53 -j REDIRECT --to-ports 5591
36- iptables -t nat -A ADGUARD -p tcp --dport 53 -j REDIRECT --to-ports 5591
37- ```
38- - service.sh 片段
39- ``` sh
40- setuidgid root:net_admin " $ADG_DIR /AdGuardHome" &
41- ```
42-
43- 其将AdGuardHome程序的用户设置为net_admin,然后在规则排除掉net_admin的请求(否则会导致网络回环)
4427# 鸣谢
4528- [ AdguardHome_magisk] ( https://github.com/410154425/AdGuardHome_magisk )
46- - [ akashaProxy] ( https://github.com/ModuleList/akashaProxy )
29+ - [ akashaProxy] ( https://github.com/ModuleList/akashaProxy )
30+ - [ box_for_magisk] ( https://github.com/taamarin/box_for_magisk )
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ iptables -t nat -N ADGUARD
22# 返回所有 AdGuardHome 的请求
33iptables -t nat -A ADGUARD -m owner --uid-owner root --gid-owner net_admin -j RETURN
44# 将 53 端口所有 udp tcp 流量转发到 adguard home
5+ # iptables -t nat -A ADGUARD -p udp --dport 53 -j DNAT --to-destination 127.0.0.1:5591
6+ # iptables -t nat -A ADGUARD -p tcp --dport 53 -j DNAT --to-destination 127.0.0.1:5591
57iptables -t nat -A ADGUARD -p udp --dport 53 -j REDIRECT --to-ports 5591
68iptables -t nat -A ADGUARD -p tcp --dport 53 -j REDIRECT --to-ports 5591
79# 将 ADGUARD 规则添加到 OUTPUT
Original file line number Diff line number Diff line change 2323 ratelimit_whitelist : []
2424 refuse_any : true
2525 upstream_dns :
26- - ' #https://1.12.12.12/dns-query'
27- - ' #https://120.53.53.53/dns-query'
28- - ' #https://223.5.5.5/dns-query'
29- - ' #https://223.6.6.6/dns-query'
30- - 223.5.5.5
26+ - https://1.12.12.12/dns-query
27+ - https://120.53.53.53/dns-query
28+ - https://223.5.5.5/dns-query
29+ - https://223.6.6.6/dns-query
3130 upstream_dns_file : " "
3231 bootstrap_dns :
33- - 0.0.0.0
32+ - 1.1.1.1
33+ - 8.8.8.8
3434 fallback_dns :
35- - ' # https://1.1.1.1/dns-query'
35+ - https://1.1.1.1/dns-query
3636 upstream_mode : load_balance
3737 fastest_timeout : 1s
3838 allowed_clients : []
6969 serve_http3 : false
7070 use_http3_upstreams : false
7171 serve_plain_dns : true
72- hostsfile_enabled : true
7372tls :
7473 enabled : false
7574 server_name : " "
8685 private_key_path : " "
8786 strict_sni_check : false
8887querylog :
89- dir_path : " "
9088 ignored : []
9189 interval : 6h
9290 size_memory : 1000
9391 enabled : true
9492 file_enabled : true
9593statistics :
96- dir_path : " "
9794 ignored : []
9895 interval : 24h
9996 enabled : true
@@ -137,15 +134,15 @@ filtering:
137134 pixabay : true
138135 yandex : true
139136 youtube : true
140- blocking_mode : default
137+ blocking_mode : null_ip
141138 parental_block_host : family-block.dns.adguard.com
142139 safebrowsing_block_host : standard-block.dns.adguard.com
143140 rewrites : []
144141 safebrowsing_cache_size : 1048576
145142 safesearch_cache_size : 1048576
146143 parental_cache_size : 1048576
147144 cache_time : 30
148- filters_update_interval : 72
145+ filters_update_interval : 168
149146 blocked_response_ttl : 30
150147 filtering_enabled : true
151148 parental_enabled : false
171168 group : " "
172169 user : " "
173170 rlimit_nofile : 0
174- schema_version : 28
171+ schema_version : 27
You can’t perform that action at this time.
0 commit comments