What We’re Testing
Subnet routing allows a tailnet machine to act as a gateway for a local network, advertising a CIDR block so other peers can reach it. The org-level allow_subnet_routing boolean in org_settings gates this capability.
Backend — handlers/org-management.ts, action update_org_settings:
- Endpoint:
POST /api/org-managementwithaction: "update_org_settings",org_id,allow_subnet_routing - Authorization:
isOrgAdminrequired - DB column:
org_settings.allow_subnet_routing(boolean, defaulttrueper the INSERT default in the handler) - Write path: UPDATE if
org_settingsrow exists, INSERT otherwise - Response:
{ "updated": true }
Frontend — SettingsPage.tsx:
- The Network Features card has a Subnet Routing toggle.
- Reads
settings?.allow_subnet_routing ?? true(defaults totruewhen the row doesn’t exist yet). - On toggle, calls
updateSettings({ allow_subnet_routing: v })which issuesPATCH /api/db/org_settings.
CLI — subnet advertisement:
ztna set --advertise-routes <cidr>announces a subnet from the client.- The
machines.advertised_routescolumn stores the advertised CIDR.
Your Test Setup
| Machine | Role |
|---|---|
| ⊞ Win-A | Admin browser session — toggles the setting |
| 🐧 Linux-C | Connected to tailnet — advertises test subnet |
Prerequisites: Both machines are online. 🐧 Linux-C has ztna connected (ztna up). You have an admin JWT token available.
ST1 — Verify Subnet Routing Default State
What it verifies: The allow_subnet_routing field defaults to true, so the toggle should already be ON for a newly created org.
Steps:
- Log in to
https://login.quickztna.comas an admin on ⊞ Win-A . - Navigate to Settings > General tab.
- Scroll to the Network Features card.
- Observe the Subnet Routing toggle state.
Expected behavior:
- Toggle is in the ON (active) state.
- Help text reads: “Allow machines to advertise subnet routes”
Pass: Toggle is ON by default.
Fail / Common issues:
- Toggle shows OFF — the
org_settingsrow was explicitly inserted withallow_subnet_routing = false, or a previous test set it to false. Re-enable it for subsequent sub-tests.
ST2 — Advertise a Subnet Route from Linux-C When Enabled
What it verifies: With allow_subnet_routing = true, a machine can advertise a CIDR block and it is stored in machines.advertised_routes.
Steps:
- Confirm
allow_subnet_routingistrueon the Settings page. - On 🐧 Linux-C , advertise a test subnet (use a non-conflicting private range):
sudo ztna set --advertise-routes 192.168.100.0/24
- Check status:
ztna status
- In the dashboard on ⊞ Win-A , navigate to Machines and click on 🐧 Linux-C .
Expected behavior:
ztna setreturns without error.ztna statusshowsAdvertisedRoutes: 192.168.100.0/24.- The machine detail page in the dashboard shows the advertised route.
Pass: Route is advertised and visible in the dashboard.
Fail / Common issues:
- “subnet routing not allowed for this org” error — the
allow_subnet_routingflag isfalse. Check the Settings page and toggle it ON. - Route not visible in dashboard — the heartbeat may not have fired yet. Wait 30 seconds or run
ztna down && ztna upto re-register.
ST3 — Toggle Subnet Routing OFF via Dashboard
What it verifies: Disabling the toggle writes allow_subnet_routing = false to org_settings.
Steps:
- On ⊞ Win-A , click the Subnet Routing toggle to turn it OFF.
- Observe the network request in browser DevTools > Network.
Expected behavior:
- Toggle moves to the OFF state.
- No error toast.
- DevTools shows a PATCH to
/api/db/org_settingswithallow_subnet_routing: false, returning HTTP 200.
Pass: Toggle is OFF. PATCH request confirmed in DevTools.
Fail / Common issues:
- Toast “Failed to update settings” — check the PATCH response status. If 404, the
org_settingsrow does not exist for this org; use the API path (ST4) instead to trigger an upsert.
ST4 — API Disable and Verify Subnet Advertisement Blocked
What it verifies: After setting allow_subnet_routing = false via the API, a new attempt to advertise routes is rejected.
Steps:
- Disable subnet routing via API:
curl -s -X POST https://login.quickztna.com/api/org-management \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"action":"update_org_settings","org_id":"<org_id>","allow_subnet_routing":false}'
- On 🐧 Linux-C , run
ztna downthenztna upto re-register. - Attempt to advertise a route:
sudo ztna set --advertise-routes 10.10.10.0/24
Expected behavior:
- API returns HTTP 200
updated: true. - The
ztna set --advertise-routescommand returns an error or the control plane strips the advertisement. ztna statusdoes not showAdvertisedRoutes.- Settings page toggle is OFF after reload.
Pass: Advertisement is blocked when allow_subnet_routing = false.
Fail / Common issues:
- Route still advertised — the machine may be using a cached configuration. Run
ztna down && ztna upto force a full re-registration with the updated org settings.
ST5 — Re-enable and Confirm Round-Trip
What it verifies: Subnet routing can be re-enabled and machines accept route advertisements again, proving the toggle is fully bidirectional.
Steps:
- Re-enable via API:
curl -s -X POST https://login.quickztna.com/api/org-management \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{"action":"update_org_settings","org_id":"<org_id>","allow_subnet_routing":true}'
- On 🐧 Linux-C , run
ztna down && ztna up. - Re-advertise the subnet:
sudo ztna set --advertise-routes 192.168.100.0/24
- Verify with
ztna status.
Expected behavior:
- API returns
updated: true. - Route advertisement is accepted.
ztna statusshowsAdvertisedRoutes: 192.168.100.0/24.- Settings page toggle is back ON.
Pass: Full round-trip confirmed — disable then re-enable works correctly.
Fail / Common issues:
- After re-enable, the toggle still appears OFF on the Settings page — do a hard refresh (Ctrl+Shift+R) to bypass the React state cache and force a fresh fetch from
/api/db/org_settings.
Summary
| Sub-test | Exercises | Key assertion |
|---|---|---|
| ST1 | Default state | Subnet Routing toggle is ON by default |
| ST2 | Advertise route when enabled | ztna set --advertise-routes accepted, visible in dashboard |
| ST3 | Dashboard toggle OFF | PATCH to /api/db/org_settings with allow_subnet_routing: false |
| ST4 | API disable + verify blocked | Route advertisement rejected after allow_subnet_routing = false |
| ST5 | Re-enable round-trip | Re-enable restores advertisement capability end-to-end |