This repository has been archived on 2026-07-09. You can view files and clone it, but cannot push or open issues or pull requests.
agent-knowledge-base-archived/problems/tor-blocked-by-isp-vpn-socks5-fix.md
Claude Code cd86f4e0f5 Add Tor VPN fix: ISP blocking → SOCKS5 via CT200 VPN Gateway
- New problem doc: tor-blocked-by-isp-vpn-socks5-fix.md
  * Root cause: ISP (РКН) blocks Tor relay IPs via DPI
  * Solution: dante SOCKS5 on CT200 → awg0 → UfoHosting VPS
  * Config: torrc Socks5Proxy + LND numgraphsyncpeers=0
- Updated services.md: added VPN Gateway and Lightning Network sections

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 16:07:48 +03:00

4.4 KiB
Raw Permalink Blame History

Tor заблокирован ISP (РКН) — решение через SOCKS5 → VPN Gateway

Симптомы

  • Tor container (lightning_tor_1, bitcoin_tor_1) застрял на "Bootstrapped 10% (conn_done): Connected to a relay"
  • Логи: 63+ "connections died in state connect()ing" / "handshaking (TLS)"
  • LND показывает num_peers: 0
  • Прямая проверка: timeout 3 bash -c "echo > /dev/tcp/86.59.21.38/443" → BLOCKED

Причина

ISP (Россия / РКН) блокирует TCP подключения к IP-адресам Tor relay на уровне DPI. Блокируются также bridges.torproject.org и circumvention.torproject.org. Стандартные Tor bootstrap адреса не доступны.

Решение

Компоненты

  • CT200 (192.168.170.254) — VPN Gateway с AmneziaWG туннелем awg0
  • awg0 → UfoHosting VPS (4min.pw = 45.12.135.156), НЕ российский хостинг
  • dante — SOCKS5 прокси на CT200, исходящие через awg0
  • Source-based routing — трафик с 10.8.1.60 (IP awg0) → table 100 → awg0

Схема

Tor контейнер → Socks5Proxy 192.168.170.254:1080 (dante на CT200)
    → source routing: ip rule from 10.8.1.60 → table 100 → awg0
    → AmneziaWG туннель → UfoHosting VPS (45.12.135.156)
    → Tor relay (6/8 Dir Authorities доступны)
    → Tor сеть (Bootstrap 100%)

Что было настроено

CT200 — dante SOCKS5:

# /etc/danted.conf
internal: 192.168.170.254 port = 1080
external: awg0
socksmethod: none
clientmethod: none
client pass { from: 192.168.170.0/24 to: 0.0.0.0/0 }
socks pass { from: 0.0.0.0/0 to: 0.0.0.0/0; protocol: tcp udp }

Сервис: systemctl enable --now danted

CT200 — routing (персистентно через vpn-start.sh):

# /usr/local/bin/vpn-start.sh
ip rule add from 10.8.1.60 lookup 100 2>/dev/null || true
# (добавлено к существующим правилам)

torrc для lightning и bitcoin:

SocksPort 0.0.0.0:9050
Socks5Proxy 192.168.170.254:1080

# Hidden Services (остальное без изменений)
HiddenServiceDir /data/app-lightning-rest
HiddenServicePort 8080 10.21.21.9:8080
HiddenServiceDir /data/app-lightning-grpc
HiddenServicePort 10009 10.21.21.9:10009

Файлы:

  • /opt/umbrel-data/app-data/lightning/torrc
  • /opt/umbrel-data/app-data/bitcoin/torrc

LND config (umbrel-lnd.conf):

numgraphsyncpeers=0

Путь: /opt/umbrel-data/app-data/lightning/data/lnd/umbrel-lnd.conf Зачем: LND без этой настройки запрашивает полный gossip sync с блока 0 (~1M блоков) от каждого peer → peer сбрасывает соединение после 60 секунд (rate limit). С numgraphsyncpeers=0 LND использует только пассивный gossip.

Результат

  • Lightning Tor: Bootstrapped 100% ✓
  • Bitcoin Tor: Bootstrapped 100% ✓
  • LND: num_peers=4+ (автоматически), synced_to_chain=true
  • synced_to_graph=false — нормально для ноды без каналов при numgraphsyncpeers=0

Проверки

# Тест SOCKS5 прокси
curl -x socks5://192.168.170.254:1080 https://ifconfig.me
# Должен вернуть: 45.12.135.156 (IP UfoHosting VPS)

# Тест Tor relay через SOCKS5
curl -x socks5://192.168.170.254:1080 -o /dev/null -w '%{http_code}' http://131.188.40.189:80
# Должен вернуть 404 (Tor relay ответил на HTTP запрос)

# Статус dante
ssh CT200: systemctl status danted

# Статус Tor bootstrap
docker logs lightning_tor_1 --tail 5

Похожие сервисы

Любой новый сервис которому нужен доступ к заблокированным ресурсам — использовать Socks5Proxy 192.168.170.254:1080.

Примечание

  • VPN Gateway UI: http://192.168.170.254:8088 (admin/cityweek)
  • awgPeak = UfoHosting, awg0, endpoint 4min.pw:41934
  • nuxtcloud = второй сервер (31.76.18.238:32312), можно активировать как awg1 для резерва
  • Tor relay IPs tor26 (86.59.21.38) и dizum (194.109.206.212) не доступны даже через VPN — остальные 6 работают