feat: implement ZeroTier exit gateway switcher
Adds the luci-app-zt-gateway package: a LuCI app + rpcd/ucode backend +
shell switch script that reconfigures which remote ZeroTier node acts as
the internet exit gateway for WIBLAN clients (10.11.13.0/24).
- Makefile (luci.mk, arch-independent)
- UCI config skeleton with three sample gateways
- rpcd ACL + menu entry
- zt-gateway.uc rpcd backend exposing status / switch / health /
drain_status / cancel_drain ubus methods
- zt-gateway-switch shell script implementing force + graceful modes:
* force: pre-flight ping, atomic route replace, conntrack flush,
UCI/hotplug/rc.local persistence
* graceful: dual-table drain using CONNMARK fwmark 0x100 at
priority 99, background drain monitor with two-consecutive-zero
completion and timeout-forced fallback to force
- LuCI overview.js: gateway radio list, mode select, drain progress
panel, cancel-drain button, health polling
- Docker test harness (docker-compose + Dockerfile.router +
router/gw entrypoints) exercising the switch script against real
iproute2/iptables/conntrack on two simulated exit nodes
Verified against the harness: force switch, graceful drain to natural
completion, pre-flight blocking of unreachable gateways (force + graceful),
and drain-timeout forced fallback.
This commit is contained in:
25
root/usr/share/rpcd/acl.d/luci-app-zt-gateway.json
Normal file
25
root/usr/share/rpcd/acl.d/luci-app-zt-gateway.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"luci-app-zt-gateway": {
|
||||
"description": "ZeroTier Exit Gateway switching",
|
||||
"read": {
|
||||
"uci": ["zt-gateway", "network"],
|
||||
"ubus": {
|
||||
"zt-gateway": ["status", "health", "drain_status"]
|
||||
},
|
||||
"file": {
|
||||
"/etc/hotplug.d/net/99-zerotier-bridge": ["read"],
|
||||
"/etc/rc.local": ["read"]
|
||||
}
|
||||
},
|
||||
"write": {
|
||||
"uci": ["zt-gateway", "network"],
|
||||
"ubus": {
|
||||
"zt-gateway": ["switch", "cancel_drain"]
|
||||
},
|
||||
"file": {
|
||||
"/etc/hotplug.d/net/99-zerotier-bridge": ["write"],
|
||||
"/etc/rc.local": ["write"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user