diff --git a/README.md b/README.md index fdd00e0..1a3a8f5 100644 --- a/README.md +++ b/README.md @@ -363,6 +363,13 @@ RU-адреса, без OpenVPN, Tailscale, торрентов и `PUSH`; сво `wget`/`opkg` самого роутера (обновления kit, ядро) нужна ещё запись в dnsmasq: `uci add_list dhcp.@dnsmasq[0].address='/sam-hub.net/192.168.64.20'`. +Правила выбираются по имени сайта: его mihomo знает из своего DNS или достаёт сниффером из +рукопожатия TLS/QUIC. Сайты за Cloudflare с ECH (браузер получил ключи через свой DoH) +показывают в рукопожатии не своё имя, а `cloudflare-ech.com`. Такое имя сниффер пропускает +(`skip-domain`), иначе `.ru`-сайт за Cloudflare уходил бы в `MAIN`. Если устройство спрашивает DNS +в обход роутера («Безопасный DNS» в браузере, «Частный DNS» на Android), имени у mihomo нет +вовсе, и правила по доменам для такого трафика не работают. + На `foreign` российские домены не попадают в исключения fake-ip: их разрешает RU-нода, а для прямого трафика DNS — Cloudflare/Google вместо Яндекса. diff --git a/templates/sniffer/10-base.yaml b/templates/sniffer/10-base.yaml index 14f383e..cc4b7d1 100644 --- a/templates/sniffer/10-base.yaml +++ b/templates/sniffer/10-base.yaml @@ -3,6 +3,11 @@ sniffer: force-dns-mapping: true parse-pure-ip: true override-destination: false + # ECH: browsers show the outer name cloudflare-ech.com instead of the site behind + # Cloudflare; the sniffed name wins in the rules, so .ru / own lists would miss the + # site. Skipped: the rules see the name from mihomo's DNS (fake-ip / DNS mapping). + skip-domain: + - "+.cloudflare-ech.com" sniff: HTTP: ports: [80, 8080-8880] #@!lite diff --git a/tests/expected/mobile.yaml b/tests/expected/mobile.yaml index dc5ec71..232f136 100644 --- a/tests/expected/mobile.yaml +++ b/tests/expected/mobile.yaml @@ -125,6 +125,11 @@ sniffer: force-dns-mapping: true parse-pure-ip: true override-destination: false + # ECH: browsers show the outer name cloudflare-ech.com instead of the site behind + # Cloudflare; the sniffed name wins in the rules, so .ru / own lists would miss the + # site. Skipped: the rules see the name from mihomo's DNS (fake-ip / DNS mapping). + skip-domain: + - "+.cloudflare-ech.com" sniff: HTTP: ports: [80, 8080-8880] diff --git a/tests/expected/router-boots.yaml b/tests/expected/router-boots.yaml index 9b2aaef..35046d5 100644 --- a/tests/expected/router-boots.yaml +++ b/tests/expected/router-boots.yaml @@ -122,6 +122,11 @@ sniffer: force-dns-mapping: true parse-pure-ip: true override-destination: false + # ECH: browsers show the outer name cloudflare-ech.com instead of the site behind + # Cloudflare; the sniffed name wins in the rules, so .ru / own lists would miss the + # site. Skipped: the rules see the name from mihomo's DNS (fake-ip / DNS mapping). + skip-domain: + - "+.cloudflare-ech.com" sniff: HTTP: ports: [80, 8080-8880] diff --git a/tests/expected/router-csqtt-foreign.yaml b/tests/expected/router-csqtt-foreign.yaml index e62ca84..dd54f1c 100644 --- a/tests/expected/router-csqtt-foreign.yaml +++ b/tests/expected/router-csqtt-foreign.yaml @@ -127,6 +127,11 @@ sniffer: force-dns-mapping: true parse-pure-ip: true override-destination: false + # ECH: browsers show the outer name cloudflare-ech.com instead of the site behind + # Cloudflare; the sniffed name wins in the rules, so .ru / own lists would miss the + # site. Skipped: the rules see the name from mihomo's DNS (fake-ip / DNS mapping). + skip-domain: + - "+.cloudflare-ech.com" sniff: HTTP: ports: [80, 8080-8880] diff --git a/tests/expected/router-csqtt.yaml b/tests/expected/router-csqtt.yaml index 126e124..0a6673a 100644 --- a/tests/expected/router-csqtt.yaml +++ b/tests/expected/router-csqtt.yaml @@ -126,6 +126,11 @@ sniffer: force-dns-mapping: true parse-pure-ip: true override-destination: false + # ECH: browsers show the outer name cloudflare-ech.com instead of the site behind + # Cloudflare; the sniffed name wins in the rules, so .ru / own lists would miss the + # site. Skipped: the rules see the name from mihomo's DNS (fake-ip / DNS mapping). + skip-domain: + - "+.cloudflare-ech.com" sniff: HTTP: ports: [80, 8080-8880] diff --git a/tests/expected/router-foreign.yaml b/tests/expected/router-foreign.yaml index 561e8db..dd8e1f8 100644 --- a/tests/expected/router-foreign.yaml +++ b/tests/expected/router-foreign.yaml @@ -138,6 +138,11 @@ sniffer: force-dns-mapping: true parse-pure-ip: true override-destination: false + # ECH: browsers show the outer name cloudflare-ech.com instead of the site behind + # Cloudflare; the sniffed name wins in the rules, so .ru / own lists would miss the + # site. Skipped: the rules see the name from mihomo's DNS (fake-ip / DNS mapping). + skip-domain: + - "+.cloudflare-ech.com" sniff: HTTP: ports: [80, 8080-8880] diff --git a/tests/expected/router-hwid.yaml b/tests/expected/router-hwid.yaml index 879829e..3a2bc1b 100644 --- a/tests/expected/router-hwid.yaml +++ b/tests/expected/router-hwid.yaml @@ -109,6 +109,11 @@ sniffer: force-dns-mapping: true parse-pure-ip: true override-destination: false + # ECH: browsers show the outer name cloudflare-ech.com instead of the site behind + # Cloudflare; the sniffed name wins in the rules, so .ru / own lists would miss the + # site. Skipped: the rules see the name from mihomo's DNS (fake-ip / DNS mapping). + skip-domain: + - "+.cloudflare-ech.com" sniff: HTTP: ports: [80, 8080-8880] diff --git a/tests/expected/router-ids.yaml b/tests/expected/router-ids.yaml index 7a09a2c..ecd0a20 100644 --- a/tests/expected/router-ids.yaml +++ b/tests/expected/router-ids.yaml @@ -144,6 +144,11 @@ sniffer: force-dns-mapping: true parse-pure-ip: true override-destination: false + # ECH: browsers show the outer name cloudflare-ech.com instead of the site behind + # Cloudflare; the sniffed name wins in the rules, so .ru / own lists would miss the + # site. Skipped: the rules see the name from mihomo's DNS (fake-ip / DNS mapping). + skip-domain: + - "+.cloudflare-ech.com" sniff: HTTP: ports: [80, 8080-8880] diff --git a/tests/expected/router-lite-csqtt.yaml b/tests/expected/router-lite-csqtt.yaml index a0b0d2f..15aa5b5 100644 --- a/tests/expected/router-lite-csqtt.yaml +++ b/tests/expected/router-lite-csqtt.yaml @@ -126,6 +126,11 @@ sniffer: force-dns-mapping: true parse-pure-ip: true override-destination: false + # ECH: browsers show the outer name cloudflare-ech.com instead of the site behind + # Cloudflare; the sniffed name wins in the rules, so .ru / own lists would miss the + # site. Skipped: the rules see the name from mihomo's DNS (fake-ip / DNS mapping). + skip-domain: + - "+.cloudflare-ech.com" sniff: HTTP: ports: [80, 8080] diff --git a/tests/expected/router-lite.yaml b/tests/expected/router-lite.yaml index a51421c..ca4c3b6 100644 --- a/tests/expected/router-lite.yaml +++ b/tests/expected/router-lite.yaml @@ -120,6 +120,11 @@ sniffer: force-dns-mapping: true parse-pure-ip: true override-destination: false + # ECH: browsers show the outer name cloudflare-ech.com instead of the site behind + # Cloudflare; the sniffed name wins in the rules, so .ru / own lists would miss the + # site. Skipped: the rules see the name from mihomo's DNS (fake-ip / DNS mapping). + skip-domain: + - "+.cloudflare-ech.com" sniff: HTTP: ports: [80, 8080] diff --git a/tests/expected/router-main.yaml b/tests/expected/router-main.yaml index 06b507a..644ae42 100644 --- a/tests/expected/router-main.yaml +++ b/tests/expected/router-main.yaml @@ -139,6 +139,11 @@ sniffer: force-dns-mapping: true parse-pure-ip: true override-destination: false + # ECH: browsers show the outer name cloudflare-ech.com instead of the site behind + # Cloudflare; the sniffed name wins in the rules, so .ru / own lists would miss the + # site. Skipped: the rules see the name from mihomo's DNS (fake-ip / DNS mapping). + skip-domain: + - "+.cloudflare-ech.com" sniff: HTTP: ports: [80, 8080-8880] diff --git a/tests/expected/router-minimal.yaml b/tests/expected/router-minimal.yaml index 85f9233..5de65e6 100644 --- a/tests/expected/router-minimal.yaml +++ b/tests/expected/router-minimal.yaml @@ -87,6 +87,11 @@ sniffer: force-dns-mapping: true parse-pure-ip: true override-destination: false + # ECH: browsers show the outer name cloudflare-ech.com instead of the site behind + # Cloudflare; the sniffed name wins in the rules, so .ru / own lists would miss the + # site. Skipped: the rules see the name from mihomo's DNS (fake-ip / DNS mapping). + skip-domain: + - "+.cloudflare-ech.com" sniff: HTTP: ports: [80, 8080-8880] diff --git a/tests/expected/router-whitelist-ts-my.yaml b/tests/expected/router-whitelist-ts-my.yaml index cc9617e..95f458c 100644 --- a/tests/expected/router-whitelist-ts-my.yaml +++ b/tests/expected/router-whitelist-ts-my.yaml @@ -145,6 +145,11 @@ sniffer: force-dns-mapping: true parse-pure-ip: true override-destination: false + # ECH: browsers show the outer name cloudflare-ech.com instead of the site behind + # Cloudflare; the sniffed name wins in the rules, so .ru / own lists would miss the + # site. Skipped: the rules see the name from mihomo's DNS (fake-ip / DNS mapping). + skip-domain: + - "+.cloudflare-ech.com" sniff: HTTP: ports: [80, 8080-8880] diff --git a/tests/expected/router-whitelist-ts.yaml b/tests/expected/router-whitelist-ts.yaml index b226bc5..2fe5142 100644 --- a/tests/expected/router-whitelist-ts.yaml +++ b/tests/expected/router-whitelist-ts.yaml @@ -128,6 +128,11 @@ sniffer: force-dns-mapping: true parse-pure-ip: true override-destination: false + # ECH: browsers show the outer name cloudflare-ech.com instead of the site behind + # Cloudflare; the sniffed name wins in the rules, so .ru / own lists would miss the + # site. Skipped: the rules see the name from mihomo's DNS (fake-ip / DNS mapping). + skip-domain: + - "+.cloudflare-ech.com" sniff: HTTP: ports: [80, 8080-8880] diff --git a/tests/expected/router-whitelist.yaml b/tests/expected/router-whitelist.yaml index f042785..0241eac 100644 --- a/tests/expected/router-whitelist.yaml +++ b/tests/expected/router-whitelist.yaml @@ -144,6 +144,11 @@ sniffer: force-dns-mapping: true parse-pure-ip: true override-destination: false + # ECH: browsers show the outer name cloudflare-ech.com instead of the site behind + # Cloudflare; the sniffed name wins in the rules, so .ru / own lists would miss the + # site. Skipped: the rules see the name from mihomo's DNS (fake-ip / DNS mapping). + skip-domain: + - "+.cloudflare-ech.com" sniff: HTTP: ports: [80, 8080-8880]