openspec: add-wg-relay-via-vps02 — пара bigbox<->vps01 через релей vps02 после блокировки IP 5.129.217.146 (validate -> archive)

This commit is contained in:
2026-11-27 11:21:41 +00:00
parent 02fb8f1810
commit e3d2387a84
7 changed files with 437 additions and 1 deletions
+64
View File
@@ -31,3 +31,67 @@ The system MUST verify tunnel liveness at least every 60 seconds.
- GIVEN the tunnel is down
- WHEN the watchdog fires
- THEN a notification is raised (no routine "all ok" messages)
### Requirement: Relay Through vps02 When a Direct Link Is Blocked
The WireGuard mesh MUST stay usable when the path between two nodes is
blocked by an external party, without adding a new tunnel or a new port: the
mesh MUST route the affected pair through a node that still has working links
to both sides.
#### Scenario: Blocked pair still passes traffic
- GIVEN the direct path between bigbox (`178.176.197.2`) and vps01
(`5.129.217.146`) is blocked at the IP level (ICMP, TCP and UDP all dead)
- AND vps02 (`10.8.0.4`) has live WireGuard handshakes with both nodes
- WHEN `10.8.0.1/32` is routed to vps02 on bigbox and `10.8.0.2/32` to vps02
on vps01
- THEN `ping 10.8.0.1` from bigbox succeeds without an SSH jump host
- AND the relay node forwards the packets, i.e. WireGuard on vps01 stays
untouched and keeps listening on the same port and address
#### Scenario: No new port or tunnel is opened
- GIVEN the relay is configured
- WHEN the resulting configuration is inspected
- THEN all nodes still use UDP `51820` and the existing `10.8.0.x` addresses
- AND no additional systemd tunnel unit exists on any node
#### Scenario: Blocked UDP path to the egress peer is relayed too
- GIVEN bigbox sends WireGuard keepalives to vps03 (`77.67.89.154:51820`) but
a packet capture on vps03 shows no inbound UDP from `178.176.197.2`, while
TCP and ICMP to that address work
- AND `10.8.0.3/32` on bigbox is pinned to the peer whose handshake has been
dead for hours
- WHEN `10.8.0.3/32` is moved to the vps02 peer and vps03's stale bigbox peer
is disabled
- THEN `ping 10.8.0.3` from bigbox succeeds through vps02
- AND `ping 10.8.0.2` from vps03 succeeds through vps02 in the opposite
direction
#### Scenario: Overlapping AllowedIPs do not hijack relayed traffic
- GIVEN a node carries `10.8.0.2/32` on a peer whose link is dead and
`10.8.0.0/24` on the relay peer
- WHEN a relayed packet is sent to `10.8.0.2`
- THEN the more specific `/32` MUST NOT be allowed to win, because the
longest-prefix match would send the packet down the dead link
- AND the stale `/32` is removed so the address falls under the relay peer
#### Scenario: Consumers recover on their own
- GIVEN `telegram-tunnel.service` keeps restarting because `10.8.0.1:22`
times out
- WHEN the relay restores L3 reachability to `10.8.0.1`
- THEN the service starts listening on `127.0.0.1:1080` without a manual
restart
- AND an HTTP request through that SOCKS5 port reaches Telegram
#### Scenario: Rollback keeps the blocked path blocked
- GIVEN the original `wg0.conf` files are backed up on every changed node
- WHEN the backup is restored and `wg syncconf` is applied
- THEN the pre-change peering is back
- AND the direct bigbox↔vps01 path remains blocked, which is the expected
original state rather than a regression