Openwrt 分流

您所在的位置:网站首页 openclash教程 Openwrt 分流

Openwrt 分流

#Openwrt 分流| 来源: 网络整理| 查看: 265

​ 关键字: openwrt, smartdns, adguardhome, openclash, 分流, 缓存, 去广告

目的: openclash 分流, smartdns 缓存DNS, adguardhome 去广告

设备及系统信息: 在这里插入图片描述

实现效果:

在这里插入图片描述

思路: smartdns 作为 openclash 上游服务器, openclash 作为 adguardhome 上游服务器

smartdns:

第一服务器 在这里插入图片描述

在这里插入图片描述

第二服务器

在这里插入图片描述

上游服务器 分组 CHINA

在这里插入图片描述

上游服务器 分组 GW

在这里插入图片描述

openclash:

全局设置 - 运行模式

在这里插入图片描述

全局设置 - DNS 设置

在这里插入图片描述

自定义 DNS 服务器

在这里插入图片描述

adguardhome

使用 53 端口 代替 dnsmasq

在这里插入图片描述

DNS 设置

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

DHCP and DNS 高级设置 Network -> DHCP and DNS -> Advanced Settings 在这里插入图片描述

附录

smartdns 配置 file: /etc/config/smartdns

config smartdns option server_name 'CHINA' option port '6913' option tcp_server '1' option ipv6_server '1' option dualstack_ip_selection '1' option serve_expired '1' option resolve_local_hostnames '1' option force_aaaa_soa '0' option force_https_soa '0' option rr_ttl_min '172800' option rr_ttl_max '345600' option seconddns_port '7913' option seconddns_tcp_server '1' option seconddns_force_aaaa_soa '0' option coredump '0' option seconddns_server_group 'GW' option auto_set_dnsmasq '0' option seconddns_no_rule_ipset '0' option seconddns_no_rule_soa '0' option cache_size '2000000' option seconddns_no_speed_check '1' option seconddns_no_dualstack_selection '0' option seconddns_no_rule_addr '1' option seconddns_no_rule_nameserver '0' option seconddns_no_cache '0' option prefetch_domain '1' option enabled '1' option seconddns_enabled '1' option old_port '6913' option old_enabled '1' option old_auto_set_dnsmasq '0' config server option enabled '1' option name 'DNSPod DNS' option ip '119.29.29.29' option type 'udp' option server_group 'CHINA' option blacklist_ip '0' config server option enabled '1' option name 'DNSPod DNS' option ip '182.254.116.116' option type 'udp' option server_group 'CHINA' option blacklist_ip '0' config server option enabled '1' option name '114DNS' option ip '114.114.114.114' option type 'udp' option server_group 'CHINA' option blacklist_ip '0' config server option enabled '1' option name '114DNS' option ip '114.114.114.115' option type 'udp' option server_group 'CHINA' option blacklist_ip '0' config server option enabled '1' option name '阿里 AliDNS' option ip '223.5.5.5' option type 'udp' option server_group 'CHINA' option blacklist_ip '0' config server option enabled '1' option name '阿里 AliDNS' option ip '223.6.6.6' option type 'udp' option server_group 'CHINA' option blacklist_ip '0' config server option enabled '1' option name '腾讯 TenDNS' option ip '119.29.29.29' option type 'udp' option blacklist_ip '0' option server_group 'CHINA' config server option enabled '1' option name '腾讯 TenDNS' option ip '182.254.116.116' option type 'udp' option server_group 'CHINA' option blacklist_ip '0' config server option enabled '1' option ip '8.8.8.8' option server_group 'GW' option blacklist_ip '0' option name 'Google DNS' option port '853' option type 'tls' option no_check_certificate '0' config server option enabled '1' option name 'Google DNS' option ip '8.8.4.4' option server_group 'GW' option blacklist_ip '0' option port '853' option type 'tls' option no_check_certificate '0' config server option enabled '1' option name 'V2EX DNS' option ip '199.91.73.222' option server_group 'GW' option blacklist_ip '0' option port '853' option type 'tls' option no_check_certificate '0' config server option enabled '1' option name 'V2EX DNS' option ip '178.79.131.110' option server_group 'GW' option blacklist_ip '0' option port '853' option type 'tls' option no_check_certificate '0' config server option enabled '1' option name 'Cloudflare DNS' option ip '1.1.1.1' option server_group 'GW' option blacklist_ip '0' option port '853' option type 'tls' option no_check_certificate '0' config server option enabled '1' option name 'Cloudflare DNS' option ip '1.0.0.1' option server_group 'GW' option blacklist_ip '0' option port '853' option type 'tls' option no_check_certificate '0' config server option enabled '1' option name 'Open DNS' option ip '208.67.222.222' option server_group 'GW' option blacklist_ip '0' option port '853' option type 'tls' option no_check_certificate '0' config server option enabled '1' option name 'Open DNS' option ip '208.67.220.220' option server_group 'GW' option blacklist_ip '0' option port '853' option type 'tls' option no_check_certificate '0' config server option enabled '1' option name '威瑞信 DNS' option ip '64.6.64.6' option server_group 'GW' option blacklist_ip '0' option port '853' option type 'tls' option no_check_certificate '0' config server option enabled '1' option name '威瑞信 DNS' option ip '64.6.65.6' option server_group 'GW' option blacklist_ip '0' option port '853' option type 'tls' option no_check_certificate '0' config server option enabled '1' option name 'Google DNS' option ip '2001:4860:4860::8888' option type 'udp' option server_group 'GW' option blacklist_ip '0' config server option enabled '1' option name 'Google DNS' option ip '2001:4860:4860::8844' option type 'udp' option server_group 'GW' option blacklist_ip '0' config server option enabled '1' option name 'Cloudflare DNS' option ip '2606:4700:4700::1111' option type 'udp' option server_group 'GW' option blacklist_ip '0' config server option enabled '1' option name 'Cloudflare DNS' option ip '2606:4700:4700::1001' option type 'udp' option server_group 'GW' option blacklist_ip '0'

adguardhome 配置: file: /etc/AdGuardHome.yaml 用户名: admin 密码: adminadmin

bind_host: 0.0.0.0 bind_port: 3000 beta_bind_port: 0 users: - name: admin password: $2a$10$tK6Zv2oPzAm.IyqSBXmhNu2VALRNGO/FaiFqfEV60Ne9t.MHygUse auth_attempts: 5 block_auth_min: 15 http_proxy: "" language: "" debug_pprof: false web_session_ttl: 720 dns: bind_hosts: - 0.0.0.0 port: 53 statistics_interval: 7 querylog_enabled: true querylog_file_enabled: true querylog_interval: 168h querylog_size_memory: 1000 anonymize_client_ip: false protection_enabled: true blocking_mode: nxdomain blocking_ipv4: "" blocking_ipv6: "" blocked_response_ttl: 10 parental_block_host: family-block.dns.adguard.com safebrowsing_block_host: standard-block.dns.adguard.com ratelimit: 0 ratelimit_whitelist: [] refuse_any: true upstream_dns: - 127.0.0.1:7874 upstream_dns_file: "" bootstrap_dns: - 127.0.0.1:6913 all_servers: true fastest_addr: false fastest_timeout: 1s allowed_clients: [] disallowed_clients: [] blocked_hosts: - version.bind - id.server - hostname.bind trusted_proxies: - 127.0.0.0/8 - ::1/128 cache_size: 0 cache_ttl_min: 0 cache_ttl_max: 0 cache_optimistic: false bogus_nxdomain: [] aaaa_disabled: false enable_dnssec: false edns_client_subnet: false max_goroutines: 300 handle_ddr: true ipset: [] ipset_file: "" filtering_enabled: true filters_update_interval: 24 parental_enabled: false safesearch_enabled: false safebrowsing_enabled: false safebrowsing_cache_size: 1048576 safesearch_cache_size: 1048576 parental_cache_size: 1048576 cache_time: 30 rewrites: [] blocked_services: - tiktok upstream_timeout: 10s private_networks: [] use_private_ptr_resolvers: true local_ptr_upstreams: [] serve_http3: false use_http3_upstreams: false tls: enabled: false server_name: "" force_https: false port_https: 443 port_dns_over_tls: 853 port_dns_over_quic: 853 port_dnscrypt: 0 dnscrypt_config_file: "" allow_unencrypted_doh: false certificate_chain: "" private_key: "" certificate_path: "" private_key_path: "" strict_sni_check: false filters: - enabled: true url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt name: AdGuard DNS filter id: 1628750870 - enabled: true url: https://anti-ad.net/easylist.txt name: 'CHN: anti-AD' id: 1628750871 - enabled: true url: https://adaway.org/hosts.txt name: AdAway Default Blocklist id: 1666183470 - enabled: true url: https://someonewhocares.org/hosts/zero/hosts name: Dan Pollock's List id: 1666183471 - enabled: true url: https://raw.githubusercontent.com/DandelionSprout/adfilt/master/GameConsoleAdblockList.txt name: Game Console Adblock List id: 1666183472 - enabled: true url: https://abp.oisd.nl/basic/ name: OISD Blocklist Basic id: 1666183473 - enabled: true url: https://pgl.yoyo.org/adservers/serverlist.php?hostformat=adblockplus&showintro=1&mimetype=plaintext name: Peter Lowe's List id: 1666183474 - enabled: true url: https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV-AGH.txt name: Perflyst and Dandelion Sprout's Smart-TV Blocklist id: 1666183475 - enabled: true url: https://raw.githubusercontent.com/DandelionSprout/adfilt/master/Alternate%20versions%20Anti-Malware%20List/AntiMalwareAdGuardHome.txt name: Dandelion Sprout's Anti-Malware List id: 1666183476 - enabled: true url: https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/hosts.txt name: NoCoin Filter List id: 1666183477 - enabled: true url: https://raw.githubusercontent.com/durablenapkin/scamblocklist/master/adguard.txt name: Scam Blocklist by DurableNapkin id: 1666183478 - enabled: true url: https://raw.githubusercontent.com/mitchellkrogza/The-Big-List-of-Hacked-Malware-Web-Sites/master/hosts name: The Big List of Hacked Malware Web Sites id: 1666183479 - enabled: true url: https://malware-filter.gitlab.io/malware-filter/urlhaus-filter-agh-online.txt name: Online Malicious URL Blocklist id: 1666183480 - enabled: true url: https://raw.githubusercontent.com/ABPindo/indonesianadblockrules/master/subscriptions/abpindo.txt name: 'IDN: ABPindo' id: 1666183481 - enabled: true url: https://raw.githubusercontent.com/DRSDavidSoft/additional-hosts/master/domains/blacklist/unwanted-iranian.txt name: 'IRN: Unwanted Iranian domains' id: 1666183482 - enabled: true url: https://filtri-dns.ga/filtri.txt name: 'ITA: Filtri-DNS' id: 1666183483 - enabled: true url: https://raw.githubusercontent.com/yous/YousList/master/hosts.txt name: 'KOR: YousList' id: 1666183484 - enabled: true url: https://raw.githubusercontent.com/cchevy/macedonian-pi-hole-blocklist/master/hosts.txt name: 'MKD: Macedonian Pi-hole Blocklist' id: 1666183485 - enabled: true url: https://easylist-downloads.adblockplus.org/easylistdutch.txt name: 'NLD: Easylist' id: 1666183486 - enabled: true url: https://raw.githubusercontent.com/DandelionSprout/adfilt/master/NorwegianExperimentalList%20alternate%20versions/NordicFiltersAdGuardHome.txt name: 'NOR: Dandelion Sprouts nordiske filtre' id: 1666183487 - enabled: true url: https://raw.githubusercontent.com/MajkiIT/polish-ads-filter/master/polish-pihole-filters/hostfile.txt name: 'POL: Polish filters for Pi hole' id: 1666183488 - enabled: true url: https://raw.githubusercontent.com/lassekongo83/Frellwits-filter-lists/master/Frellwits-Swedish-Hosts-File.txt name: 'SWE: Frellwit''s Swedish Hosts File' id: 1666183489 - enabled: true url: https://abpvn.com/android/abpvn.txt name: 'VNM: ABPVN List' id: 1666183490 - enabled: true url: https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt name: WindowsSpyBlocker - Hosts spy rules id: 1666183491 - enabled: true url: https://gitee.com/xinggsf/Adblock-Rule/raw/master/rule.txt name: AdGuard Rule id: 1666188951 - enabled: true url: https://gitee.com/xinggsf/Adblock-Rule/raw/master/mv.txt name: AdGuard MV id: 1666188952 - enabled: true url: http://sub.adtchrome.com/adt-chinalist-easylist.txt name: China Eazy List id: 1666188954 - enabled: true url: https://www.i-dont-care-about-cookies.eu/abp/ name: I don't Care About Cookies id: 1666188955 - enabled: true url: https://gist.githubusercontent.com/Ewpratten/a25ae63a7200c02c850fede2f32453cf/raw/b9318009399b99e822515d388b8458557d828c37/hosts-yt-ads name: Youtube Ads List id: 1666188956 - enabled: true url: https://malware-filter.gitlab.io/malware-filter/phishing-filter-agh.txt name: Phishing URL Blocklist (PhishTank and OpenPhish) id: 1668442517 - enabled: true url: https://raw.githubusercontent.com/AssoEchap/stalkerware-indicators/master/generated/hosts name: Stalkerware Indicators List id: 1668442518 - enabled: true url: https://malware-filter.gitlab.io/malware-filter/urlhaus-filter-agh.txt name: Malicious URL Blocklist (URLHaus) id: 1668442519 - enabled: true url: https://raw.githubusercontent.com/bkrucarci/turk-adlist/master/hosts name: 'TUR: turk-adlist' id: 1668442521 - enabled: true url: https://raw.githubusercontent.com/ABPindo/indonesianadblockrules/master/subscriptions/aghome.txt name: 'IDN: ABPindo' id: 1668442522 - enabled: true url: https://raw.githubusercontent.com/MasterKia/PersianBlocker/main/PersianBlockerHosts.txt name: 'IRN: PersianBlocker list' id: 1668442523 - enabled: true url: https://raw.githubusercontent.com/Cats-Team/AdRules/main/dns.txt name: 'CHN: AdRules DNS List' id: 1668442524 - enabled: true url: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts name: Steven Black's List id: 1668442525 - enabled: true url: https://abp.oisd.nl/ name: OISD Blocklist Full id: 1668442526 - enabled: true url: https://badmojr.gitlab.io/1hosts/Lite/adblock.txt name: 1Hosts (Lite) id: 1668442527 - enabled: true url: https://block.energized.pro/spark/formats/filter name: Energized Spark id: 1668442528 - enabled: true url: https://raw.githubusercontent.com/notracking/hosts-blocklists/master/adblock/adblock.txt name: The NoTracking blocklist id: 1668442529 - enabled: true url: https://easylist-downloads.adblockplus.org/easylist.txt name: EasyList id: 1669274963 - enabled: true url: https://easylist-downloads.adblockplus.org/easylistchina.txt name: EasyList China id: 1669274964 - enabled: true url: https://easylist-downloads.adblockplus.org/easyprivacy.txt name: EasyPrivacy id: 1669274965 - enabled: true url: https://raw.githubusercontent.com/privacy-protection-tools/anti-AD/master/anti-ad-easylist.txt name: Anti-AD id: 1669274967 - enabled: true url: https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/lazy.txt name: AdbybyLazy id: 1669274968 - enabled: true url: https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/video.txt name: AdbybyVideo id: 1669274969 - enabled: true url: https://raw.githubusercontent.com/banbendalao/ADgk/master/ADgk.txt name: ADgk id: 1669274971 - enabled: true url: https://raw.githubusercontent.com/banbendalao/ADgk/master/kill-baidu-ad.txt name: BaiduBaiJia id: 1669274972 - enabled: true url: https://raw.githubusercontent.com/zsakvo/AdGuard-Custom-Rule/master/rule/zhihu.txt name: ZhihuStandard id: 1669274973 - enabled: true url: https://raw.githubusercontent.com/zsakvo/AdGuard-Custom-Rule/master/rule/zhihu-strict.txt name: ZhihuStrict id: 1669274974 - enabled: true url: https://raw.githubusercontent.com/jdlingyu/ad-wars/master/hosts name: Dasheng id: 1669274976 - enabled: true url: https://raw.githubusercontent.com/BlueSkyXN/AdGuardHomeRules/master/all.txt name: BlueSkyXN id: 1669274977 - enabled: true url: https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjx-annoyance.txt name: CJX's Annoyance List id: 1669274978 - enabled: true url: http://winhelp2002.mvps.org/hosts.txt name: Mvps id: 1669362850 - enabled: true url: https://hblock.molinero.dev/hosts name: Hblock id: 1669362852 - enabled: true url: https://raw.githubusercontent.com/VeleSila/yhosts/master/hosts.txt name: yhosts id: 1669363016 whitelist_filters: - enabled: true url: https://raw.githubusercontent.com/Tunglies/TorrentTracker/main/domains.txt name: qBbittorrentTrackersDomain id: 1667976469 user_rules: - '@@||www.bing.com^$importan' - '@@||apple.com' - '@@||www.bing.com^$important' - '@@||cn.bing.com^$important' - '@@||t.co^' - '@@||supes.top^$important' dhcp: enabled: false interface_name: br-lan local_domain_name: lan dhcpv4: gateway_ip: 192.168.1.1 subnet_mask: 255.255.255.0 range_start: 192.168.1.200 range_end: 192.168.1.254 lease_duration: 7200 icmp_timeout_msec: 1000 options: [] dhcpv6: range_start: 2001::1 lease_duration: 7200 ra_slaac_only: false ra_allow_slaac: false clients: runtime_sources: whois: true arp: true rdns: true dhcp: true hosts: true persistent: [] log_file: "" log_max_backups: 0 log_max_size: 100 log_max_age: 3 log_compress: false log_localtime: false verbose: false os: group: "" user: "" rlimit_nofile: 0 schema_version: 14


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3