Skip to content

feat(start-wrt): manage the router through an outbound VPN - #4711

Open
gStart9 wants to merge 1 commit into
wrt/remove-wan-remote-accessfrom
wrt/vpn-router-management
Open

gStart9 wants to merge 1 commit into
wrt/remove-wan-remote-accessfrom
wrt/vpn-router-management

Conversation

@gStart9

@gStart9 gStart9 commented Nov 13, 2026

Copy link
Copy Markdown
Member

Stacked on #4710, which removes WAN remote access. As things currently stand in StartWRT 1.3.0, a router behind CGNAT cannot be reached through an Inbound VPN, so after #4710 it has no remote management path. This lets an Outbound VPN to a server you control, such as StartTunnel or a WireGuard server on a VPS, carry the router's web interface, its SSH server, or both, so you can manage the router from a laptop connected to the same server.

Summary

  • Per-VPN opt-in: each Outbound VPN gains two settings, admin_web (TCP 443 and 80) and admin_ssh (TCP 22), stored on its vpn_client section and exposed on vpn-client.list, create, and update. Both are off by default; on update, an absent field keeps its current value.
  • Firewall: for each VPN with either setting on, the VPN keeps its vpn_<iface> zone even when no profile routes through it (cleanup_orphaned_vpn_zones now counts these VPNs as in use), and startwrt_vpn_admin_* input rules admit the chosen ports from RFC 1918 and ULA sources in that zone. The zone's default input policy stays REJECT, and WireGuard still drops any source the peer's AllowedIPs does not cover.
  • Reply routing: this follows StartOS's per-gateway reply routing (start-core/policy-routing.md). Each such VPN gets a routing table, numbered from DIVERT_TABLE + 1 (5345) so it sits above both StartWRT's VLAN-tag tables and the shared divert table, holding a default route through its tunnel. A source rule for each of the tunnel's own addresses, at priority 120 (behind the DNAT-return rule), looks that table up, so the router answers a client on any subnet behind the server through the tunnel, and the kernel's reverse-path lookup succeeds the same way. The rules and routes are netifd rule/rule6/route/route6 sections, like StartWRT's other policy routing. StartOS's connection-mark rule is not needed here, because the router only answers from its own sockets and never forwards these connections.
  • UI: the add dialog and the VPN detail page each gain a "Router access" section with two switches, and a warning appears when either is on: anyone the VPN server lets through can reach the router, including the server's operator. In-app help and all new strings are in all five languages. The mock and the regenerated bindings carry the new fields.
  • Docs: outbound-vpn.md gains a Router Access section (steps, the AllowedIPs requirement, the operator warning). cgnat.md explains how to manage the router through StartTunnel or a self-hosted WireGuard server, and the FAQ's "away from home" answer and overview.md point to it. API_CONTRACT.md documents the fields, rules, tables, and priorities.
  • Changelog: a minor-added-vpn-router-access fragment (selected for release notes, with translations). feat(start-wrt): remove WAN remote access #4710's fragment and pre-update notice now say "your VPNs" rather than "your Inbound VPNs", and the fragment names both ways to manage the router remotely.

The router's HTTPS certificate already names whatever address a connection reached, so the tunnel address needs no certificate change; a device that trusts the Root CA trusts it.

Verification

  • make start-wrt-test: 936 + 37 passed, including a new test that turns router access on, checks the zone, rules, reply table, and source rules for both families, adds SSH, and then turns both off and checks that the zone, rules, and routes are gone.
  • make start-wrt-rpc-bindings: regenerated; the only changes are the two fields on OutboundVpn and the create and update requests.
  • npm run check:wrt, npm run check:i18n:wrt, and npm run check:rpc-clients (29/29) pass.
  • node scripts/changelog.mjs check-version projects/start-wrt passes.
  • A full image is building from this branch (run 43368360224) for testing on hardware.

Not run

  • On a router: the bench cannot run an Outbound VPN, so reaching the web interface and SSH through a real StartTunnel from a client on another subnet is still to be tested on the image above.
  • The de, es, fr, and pl strings were written without native-speaker review.

🤖 Generated with Claude Code

A router behind CGNAT cannot be reached through an Inbound VPN, and with
WAN remote access gone it had no remote management path at all. An
Outbound VPN can now let the private network behind its server reach the
router's web interface, its SSH server, or both, each opt-in per VPN.
This is how a router connected to StartTunnel, or to a WireGuard server
on a VPS, is managed from a laptop on the same server.

For each VPN with access on, the VPN keeps its vpn_<iface> zone whether
or not a profile routes through it, and input rules admit TCP 443/80
and/or 22 from RFC 1918 and ULA sources in that zone. Replies follow
StartOS's per-gateway reply routing: a table per VPN, numbered above the
shared divert table, holds a default route through the tunnel, and a
source rule for each of the tunnel's own addresses looks it up, so a
client on any subnet behind the server is answered through the tunnel.
They are netifd rule/route sections, like StartWRT's other policy
routing.

The add dialog and the VPN page carry two switches with a warning that
the server's operator can reach the router too. The Outbound VPN, CGNAT
and FAQ pages document the setup, and the removal's changelog entry and
pre-update notice now refer to VPNs generally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant