docs: initial plan for ZeroTier exit gateway switcher

Design: .omp/plans/zerotier-gateway-switching.md — LuCI app + rpcd/ucode backend + zt-gateway-switch shell script for force / graceful-drain gateway switching on OpenWRT.
This commit is contained in:
2026-06-19 00:03:09 +05:30
commit f6bf6e7cd4
3 changed files with 1324 additions and 0 deletions

28
.gitignore vendored Normal file
View File

@@ -0,0 +1,28 @@
# OpenWRT / LuCI build artifacts
bin/
tmp/
.build/
.config
.config.old
feeds.conf.default
feeds.conf
*.ipk
*.ipk.opk
# SDK / build cache
dl/
staging_dir*/
build_dir*/
# Translations (compiled)
*.po~
*.pot
# Common OS / editor files
.DS_Store
Thumbs.db
*.swp
*.swo
*~
.vscode/
.idea/

File diff suppressed because it is too large Load Diff

38
README.md Normal file
View File

@@ -0,0 +1,38 @@
# luci-app-zt-gateway
A LuCI application for OpenWRT that lets users switch which remote ZeroTier node
acts as the internet exit gateway for WIBLAN clients (`10.11.13.0/24`).
Users select a region/gateway, choose a switch mode, and the app reconfigures
kernel routing, conntrack, hotplug scripts, and UCI network routes with minimal
disruption.
## Switch modes
- **Force** — instant cutover (~1-2s disruption); existing connections break and
clients auto-reconnect through the new gateway. Flushes conntrack for the
WIBLAN subnet.
- **Graceful drain** — zero disruption; existing connections keep using the old
gateway via fwmark + a drain routing table, while new connections go through
the new gateway immediately. Auto-falls-back to a force switch after a
configurable timeout if drain does not complete.
## Status
> **Planning / pre-implementation.**
The full design — file structure, UCI config schema, rpcd backend (ucode),
`zt-gateway-switch` shell script, LuCI frontend, switch logic for both modes,
persistence model, health checks, rollback/safety, Docker macvlan test harness,
and build/install instructions — is the source of truth in:
[`docs/.omp/plans/zerotier-gateway-switching.md`](.omp/plans/zerotier-gateway-switching.md)
(also tracked at `.omp/plans/zerotier-gateway-switching.md`)
Implementation (Makefile, ucode backend, switch script, `overview.js`, UCI
config, ACL, menu entry) lands in subsequent commits against this repository.
## License
Apache-2.0