89 lines
5.6 KiB
Markdown
89 lines
5.6 KiB
Markdown
# REALITY-транспорт hops роутер↔хаб (наш форк)
|
||
|
||
## Суть
|
||
|
||
Upstream: один VLESS-inbound хаба на `:8443` c `network=tcp, security=none`.
|
||
Роутер дIAL-OUTит к хабу; reverse-порталы (LuCI/SSH) живут за тем же conn.
|
||
Без TLS: весь трафик и логин-данные в панели — открытым текстом внутри hops.
|
||
|
||
Форк: тот же единственный inbound, но `security=reality` — полноценное TLS-рукопожатие,
|
||
замаскированное под handshake публичного сайта-прикрытия (`dest`), без CA-сертификатов
|
||
и продлений. Аутентификация по-прежнему per-router UUID (LuCI + SSH = два UUID).
|
||
|
||
## Где что генерируется
|
||
|
||
- Хаб: `transport.json` в `STATE_DIR` (`/var/lib/owrt-remote/`), создаётся лениво
|
||
(`xray x25519` → приват/публик, `shortId` = 8 hex, `dest`=SNI из env).
|
||
- Серверный inbound: `privateKey`, `serverNames=[SNI]`, `shortIds=[shortId]`,
|
||
`dest=<SNI>:443`, `xver=0`.
|
||
- Клиент (роутер): `publicKey`, `serverName`, `fingerprint` (chrome). shortId клиенту
|
||
не нужен (сервер кодирует его в «фейковом» сертификате).
|
||
- Конфиг роутера хаб отдаёт готовыми `uci set owrtremote.main.security/reality_*`
|
||
(карточка роутера / print-openwrt-config / панельный «Xray настройки» на роутере).
|
||
- Heartbeat остаётся отдельным HTTPS-каналом (через панель/Pangolin), к xray не относится.
|
||
|
||
## Пин версии xray на хабе (важно!)
|
||
|
||
Upstream-регрессия **XTLS/Xray-core#7259**: REALITY-сервер 26.9.8+ не принимает
|
||
рукопожатия клиентов (клиент: `received real certificate (potential MITM or redirection)`).
|
||
Практика 22.11.2026: связка 26.11.9↔26.11.9 не работает, ~~26.7.28~~ (см. таблицу матрицы
|
||
в коммите форка/заметку хаба) — хаб держим на **26.7.28**, пока upstream не выпустит фикс.
|
||
|
||
Обновление хаба на новую версию core — только после повторного прогона e2e-матрицы
|
||
(hub-generators → две локации xray → reverse-туннель через reality).
|
||
|
||
## Смена camouflage-домена
|
||
|
||
env хаба: `OWRT_REMOTE_REALITY_DEST=download.windowsupdate.com`, рестарт `owrt-remote`,
|
||
затем пересоздать конфиги роутеров (карточка → новая команда uci; shortId/pk те же, если
|
||
не трогать transport.json). Удаление `transport.json` = новая x25519-пара и новый shortId
|
||
⇒ всем роутерам нужны новые конфиги.
|
||
|
||
## Совместимость / откат
|
||
|
||
`OWRT_REMOTE_TRANSPORT=none` + рестарт = ровно upstream-поведение (но генератор конфига
|
||
роутера продолжит писать `security=none`, роутер-агент умеет оба).
|
||
Старые агенты (без полей security) не работают с reality-hub — роутер нужно обновить
|
||
(установить ipk/файлы этого форка).
|
||
|
||
|
||
## 22.11.2026: reverse + REALITY is broken on modern cores — `security=tls` is now the default
|
||
|
||
Bisect matrix (xray 26.7.28 / 26.11.9, all four pairs, loopback e2e):
|
||
|
||
* the REALITY hop itself authenticates and tunnels user traffic fine
|
||
(shortId MUST be present in the client `realitySettings`; camo dest
|
||
`www.microsoft.com` is dead because Microsoft now serves post-quantum
|
||
cert chains — use `www.cloudflare.com`);
|
||
* BUT the tag-form VLESS reverse (Rvs control channel, PR #5101) never
|
||
registers when the bridge transport is REALITY: portal logs the reality
|
||
handshake (`hs.c.conn == conn: true`) and then silence — no
|
||
`v1.rvs.cool` request is ever dispatched. Upstream reports of the same
|
||
family: XTLS/Xray-core #6242 / #6248 ("reverse broken since 26.5,
|
||
works on 26.4.25"). Our repro: relay hex-dump shows the bridge's Rvs
|
||
request on the wire, portal never responds. xray 26.4.25 was also pulled
|
||
(ghcr layers, /tmp/xraybin264) and tested: the tag-form fails there too
|
||
(26.4.25<->26.4.25 and cross-version) — upstream's "works on 26.4.25"
|
||
refers to the legacy domain-form reverse config, not PR #5101 tags.)
|
||
|
||
Working alternative shipped as `OWRT_REMOTE_TRANSPORT=tls` (default):
|
||
self-signed hub cert (hub generates it with openssl) + `pinnedPeerCertSha256`
|
||
on the router (xray removed `allowInsecure`), ALPN `h2,http/1.1`, uTLS
|
||
`fingerprint: chrome`. Verified end-to-end through hub-generated configs:
|
||
portal `entry-*` -> reverse mux -> router `router-admin` freedom redirect
|
||
= HTTP 200 on 26.11.9<->26.11.9 and 26.11.9<->26.7.28.
|
||
|
||
Pitfalls discovered along the way:
|
||
|
||
* freedom outbounds behind the reverse bridge need explicit
|
||
`finalRules: [{action: allow, network: tcp, port: ...}]` — newer cores
|
||
blackhole reverse egress by default (see also 3x-ui 6f6c7fc);
|
||
* the Rvs bridge registers ~2 s after the router xray starts (monitor
|
||
interval), healthcheck scripts must wait, or they see
|
||
`non existing outTag`;
|
||
* legacy `reverse.bridges/portals` config objects were REMOVED in 26.x —
|
||
only the tag form works.
|
||
|
||
REALITY stays selectable (`OWRT_REMOTE_TRANSPORT=reality`) for the hub
|
||
panel hop style until upstream fixes reverse-over-REALITY.
|