Skip to content

feat(start-wrt): connect a managed switch through a trunk port - #4628

Merged
dr-bonez merged 9 commits into
Start9Labs:masterfrom
JesseMarkowitz:managed-switch-support
Nov 23, 2026
Merged

dr-bonez merged 9 commits into
Start9Labs:masterfrom
JesseMarkowitz:managed-switch-support

Conversation

@JesseMarkowitz

@JesseMarkowitz JesseMarkowitz commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

An Ethernet port can now be a Managed switch port: it carries every security profile as a tagged 802.1Q VLAN, so a VLAN-capable switch behind it puts each of its own ports on a profile of its own. One router port becomes as many profiled wired ports as the switch has. Devices behind the switch appear in the Devices list under the profile they land in, and the Ethernet page lists each profile's VLAN ID under the port.

  • Backend (trunk.rs, ethernet.rs, profiles.rs): a trunk port is tagged in every profile's bridge VLAN and untagged in none, so frames arriving untagged are dropped; only profile VLANs decide whether a port is a trunk, so a membership in a bridge VLAN that belongs to no profile (one added in LuCI, or the access-point management link StartWRT: extend Security Profiles across multiple routers (Core + Satellite) #4043 would need) leaves it one; setting a trunk alone turns on VLAN filtering; a trunk cannot also carry a profile, be the WAN port, or be a USB port (InvalidTrunkPort, 1027); creating or deleting a profile adds or removes its VLAN on every trunk. Admin (VLAN 1) rides the trunk tagged like every other profile. Turning a port into a trunk is not a profile change for the devices behind it, so the link is not bounced; a trunk returning to a profile is one, and the ethernet.set preview places each device behind it in the VLAN the bridge FDB learned it on, so the confirmation from feat(start-wrt): keep reservations and published ports per profile #4466 names the devices that keep a reservation or published port for the profile they leave.
  • K1 Ethernet fix (openwrt-overlay/target/linux/spacemit/patches-6.18/0005-net-k1x-emac-allow-full-size-vlan-tagged-frames.patch): the SpacemiT EMAC dropped every tagged frame over 1518 bytes, so a trunk passed pings and small requests while downloads and TLS stalled. The patch raises the MAC's maximum frame size by the VLAN tag (MAX_FRAME_SIZE 0x5f6). No release carried tagged ports before, so it has no changelog entry of its own.
  • Profile VLAN tags: profiles.create with an explicit tag now rejects a tag another profile holds, Admin's included (the duplicate check read only bridge-vlan sections, and on a bridge without VLAN filtering Admin has none), and 0 or 4095 and above (ReservedVlanTag, 1028). The UI never offers a tag; the RPC accepts one.
  • Web: the port chooser gains a Delegate entry, on the router's own Ethernet ports and not on USB ports. Choosing it shows one confirmation, Delegate eth1?: the trust warning (anyone who can log in to the switch reaches every profile), with feat(start-wrt): keep reservations and published ports per profile #4466's leaving-profile notice folded in when it applies. Any other profile change keeps the existing reconnect dialog, so no change asks twice. Nothing on the row changes until the change is confirmed and saved. A delegated port shows Managed switch and a VLAN IDs button that opens a VLAN ID → profile table, which also opens on its own right after delegating. The Ethernet help follows the page. Strings and help in all five languages.
  • Docs: managed-switch.md is a full guide (when you need one, how it works, what can go wrong, choosing a switch, router side, planning ports, switch side, laptop test, later changes, troubleshooting, undo). managed-switch-tp-link.md, Managed Switch Notes: TP-Link Easy Smart under Reference, maps each guide step to the switch's pages and lists the firmware's non-obvious behavior; notes for other models would follow the same title. Two FAQ entries, and ethernet.md, points-of-entry.md, architecture.md and backend/ARCHITECTURE.md place the trunk in the VLAN isolation model.
  • Changelog: minor-added-managed-switch-trunk (release-notes: true) and patch-fixed-profile-vlan-tag-checks (release-notes: false). 1.4.0 is released, so the branch moves StartWRT to 1.5.0 (backend/ctrl/Cargo.toml and Cargo.lock), as the minor fragment requires.

Screenshots

From the UI's demo mode (its sample ports and profiles), not a real router. These predate 5cb985f: the entry is now Delegate, the confirmation is titled Delegate eth1?, and the VLAN IDs moved from under the port to their own dialog.

The port chooser's new entry:
1-dropdown

The confirmation it shows:
2-confirm

A trunk port afterwards, with each profile's VLAN ID:
3-vlan-ids

Open questions

  1. A trunk carries Admin (VLAN 1) tagged, which is what lets the switch's own management address and an Admin jack on the switch work. The alternative is a per-trunk "carry Admin" setting, default off, so VLAN 1 never leaves the router; the cost is that the switch's management then needs a carried profile. I kept the simpler behaviour and would rather settle this here than decide it alone.
  2. A USB Ethernet port (feat(start-wrt): use USB Ethernet adapters as LAN ports #4662) cannot be a trunk. A trunk needs full-size tagged frames, and I have not tested any USB adapter carrying them on the router, so I refused it rather than guess. If you'd rather allow it, it is one check in ethernet.rs and one @if in the port chooser.

For the release manager

This branch adds no release-notes/1.5.0.md. If you want an Important notice for the feature, a suggestion: A managed switch is only as safe as its own configuration. Every profile reaches it as a tagged VLAN, Admin included, so set the switch up before you connect it and keep its admin password private. See the Managed switch guide.

Verification

The branch is rebuilt on master b04100a05, the 1.4.0 release, as three commits: the K1 EMAC patch, the feature, and the docs. Four follow: 5cb985f reworks the port UI, a0c4d20 recognises a trunk by its profile VLANs alone, and acdb8dc with bb76cf8 keep the Admin VLAN when the last trunk is removed (from review). Master has since been merged in twice, most recently through 9a68123. Master's own new strings took the dictionary numbers up to 646, so this branch's seven strings now use 647 to 653.

  • cargo test -p startwrt-core -p uciedit -p uciedit_macros --lib in the shared Rust builder: 970 + 37 passed at a0c4d20 (968 + 37 before it). It ran at opt-level 0 rather than the repo's 3, to fit the build machine.
  • Bindings regenerated with no drift; npm run check:wrt and check:i18n:wrt on Node 24; Prettier 3.8.3 and make start-wrt-format-check clean; node scripts/changelog.mjs validate and check-version pass against the Start9 tags.
  • a0c4d20 changes the backend only and has run in the unit tests, not yet on hardware.
  • On the previous base below: riscv64 release binary built with DISABLE_RVA23=1, passing verify-isa.sh, and a full OpenWrt image built from it.

On hardware, on the previous base 42b4581c1 (which differs only by the 1.4.0 release commits, the version and the string numbers): a Banana Pi BPI-F3 running a trunk, upgraded to that image by sysupgrade with settings kept (migrations 11 → 15; the only config changes were #4689 and #4656's own):

  • Router side, no switch: ethernet.get reports the trunk; the trunk-and-profile and WAN-trunk requests are refused with nothing written; a new profile joins the trunk and deleting it leaves every config byte-identical; the trunk survives a reboot.
  • TP-Link TL-SG108E behind the trunk: a laptop on the switch's Admin port gets an Admin address and reaches the switch's page; on a port in another profile it gets that profile's address. 1500-byte pings cross the trunk to the switch and the laptop with no loss. After a switch power cut, both come back on the same addresses. The Ethernet page shows Managed switch with the VLAN IDs, and the Devices page lists both. Speed test through the trunk: 417 Mbps down.
  • Leaving-profile preview through the trunk: with a reservation for the laptop in the profile it was on, the preview of the trunk becoming an Admin port names it, and the preview to its own profile names nobody. For about five minutes after a device moves between switch ports, the bridge still holds it in both VLANs. parse_bridge_fdb then reports no VLAN, and the preview leaves the device out rather than guess.
  • USB: an adapter in a USB-A port appears as usb_eth0 in Admin and carries the laptop; its chooser has no Managed switch entry; ethernet.set with it as a trunk is refused (InvalidTrunkPort) with nothing written.

Earlier builds of this branch were tested the same way with a TL-SG208E, including setting the switch up from the guide alone, with speed tests of 624–677 Mbps through the trunk. They have also run the house router (K1) in daily use since 2026-10-25, every profile served through the trunk.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RJjVAx6ip9jA6pH5N8QxBA

@JesseMarkowitz

Copy link
Copy Markdown
Contributor Author

Added doc lessons from installing three more switches. I now have my entire home network with all wired devices connected on StartWRT profiles via managed switches.

@JesseMarkowitz

Copy link
Copy Markdown
Contributor Author

Rebuilt this branch on current master (42b4581c1), after #4662 (USB Ethernet ports) and #4466 (per-profile reservations and published ports), as three commits: the K1 EMAC fix, the feature and the docs. It merges cleanly now.

Two things changed in the merge:

  • USB ports cannot be trunks. ethernet.set refuses one with InvalidTrunkPort, and the port chooser offers Managed switch only on the router's own Ethernet ports. A trunk needs full-size tagged frames, and I haven't tested a USB adapter carrying them.
  • The leaving-profile preview sees through a trunk. When a trunk goes back to a profile, the preview places each device behind it in the VLAN the bridge learned it on, so feat(start-wrt): keep reservations and published ports per profile #4466's confirmation names the devices that keep a reservation or published port for the profile they leave.

Tested on a BPI-F3 with a TL-SG108E behind the trunk; details are in the description's Verification section. The two open questions there (Admin carried tagged, and refusing USB trunks) are the decisions I'd most like your view on.

JesseMarkowitz and others added 3 commits November 13, 2026 21:49
…frames

The vendor k1x-emac driver never programs MAC_MAXIMUM_FRAME_SIZE, so the
MAC keeps its reset default of 1518 bytes: the untagged maximum. A
VLAN-tagged full-size frame is 1522 bytes, and the MAC drops it in
hardware, before the driver sees it, so rx_dropped never moves. On a port
set to "Managed switch" this breaks every profile: pings, DNS and small
requests work, while any TCP connection stalls on its first full-size
segment. A house-router swap on a managed-switch trunk hit exactly that.

Add a kernel patch (spacemit patches-6.18/0005) that sets the limit to
mtu + ETH_HLEN + 2 * VLAN_HLEN + ETH_FCS_LEN (1526), as the mainline
k1_emac driver does. The jabber sizes (reset default 1536) already cover
it. Untagged ports are unaffected.

Verified on a K1 trunked to a TP-Link ES208G, with a StartOS server on a
profile port:
- Before: ethtool -d read 0x5ee (1518) at 0x10c. Pings with 1468 bytes of
  data (1518-byte tagged frame) passed; 1469 and 1472 failed 100%, each
  lost reply adding one to rx_len_oversize_pkts and rx_1519_plus_pkts.
- After sysupgrade to an image with this patch: the register reads 0x5f6
  (1526). 1468/1469/1472-byte pings all 10/10, with rx_1519_plus_pkts
  counting the replies and rx_len_oversize_pkts at 0. A 2.2 MB HTTPS
  transfer from the server crossed the trunk with ~1,400 full-size tagged
  frames and no drops. Settings survived the upgrade and the standing
  smoke checks are green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RJjVAx6ip9jA6pH5N8QxBA
An Ethernet port can now be a trunk instead of carrying one profile. A
trunk is a member of every profile's bridge VLAN tagged, Admin's
included, and carries nothing untagged, so a managed switch behind it
can put each of its own ports on a different profile. StartWRT defines a
port's profile itself everywhere else; a trunk delegates that decision
to the switch's configuration and trusts it, which the UI says before it
lets a port become one. Under such a port the Ethernet page lists every
profile's VLAN ID, the numbers the switch's configuration needs. A
profile created later joins every trunk as well, and a trunk alone turns
bridge VLAN filtering on, moving the `lan` interface onto `br-lan.1` as
the first non-Admin profile does.

Devices behind the switch already appear under the profile of the VLAN
the bridge learned them on, so the Devices list needs no change. A port
becoming a trunk is not a profile change: its devices keep whatever VLAN
the switch gives them, and the link is not bounced. A trunk going back
to a profile is one, and the ethernet.set preview places each device
behind it in the VLAN the bridge FDB learned it on, so the confirmation
names the devices that keep a reservation or published port for the
profile they leave. A device already in the port's new VLAN is not
leaving.

A USB Ethernet port cannot be a trunk: a trunk needs full-size tagged
frames, and no USB adapter has been tested carrying them on the router.
The UI offers the choice only on the router's own Ethernet ports.

On the wire `Port` gains `trunk: bool` (default false), reported by
`ethernet.get` and accepted by `ethernet.set`; `InvalidTrunkPort` (1027)
rejects a trunk with a profile, on the WAN port, or on a USB port.
`trunk.rs` recognises a trunk (every membership tagged) and builds a
port's membership, shared by `ethernet.rs` and `profiles.rs`.

profiles.create with an explicit vlan_tag checked it only against the
bridge-vlan sections, so on a bridge without VLAN filtering Admin's tag
had no section and could be claimed by a new profile; nothing rejected 0
or 4095 either. The check now also reads every profile's tag from the
startwrt config, and 0 and 4095 and above are ReservedVlanTag (1028).
The automatic pick stops at 4094. The web interface never sends a tag;
the RPC accepts one.

StartWRT's version moves to 1.5.0: 1.4.0 is released and this adds a
minor changelog fragment.

Verified on master b04100a (the 1.4.0 release): cargo test for
startwrt, uciedit and uciedit_macros, 968 + 37 passed (opt-level 0, to
fit the build machine); bindings regenerated without drift; check:wrt,
check:i18n:wrt, Prettier and rustfmt clean; changelog validate and
check-version pass against the Start9 tags. On the previous base,
42b4581, which differs only by the 1.4.0 release commits, the version
and these strings' numbers, the riscv64 binary passed verify-isa.sh and
an OpenWrt image was built from it. On a BPI-F3 upgraded to that image
with settings kept, a TP-Link TL-SG108E behind the trunk put a laptop in
Admin or another profile by switch port, carried 1500-byte packets,
recovered from a power cut, and the preview named a device with a
reservation in the profile it would leave. A USB Ethernet adapter came
up in Admin and was refused as a trunk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RJjVAx6ip9jA6pH5N8QxBA
"Connecting a Managed Switch" covers when one is needed, how the trunk
works, what can go wrong, choosing a switch, the router side, planning
ports, the switch side, a laptop test, later changes, troubleshooting,
and undoing it. "Managed Switch Notes: TP-Link Easy Smart", under
Reference, maps each step to that firmware's pages and lists its
non-obvious behaviour. The Ethernet and Points of Entry pages, the
architecture page and two FAQ entries place a trunk in the VLAN
isolation model.

The guide was revised after someone other than its author set up a
switch from it alone, and again after three more switches were
installed from it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RJjVAx6ip9jA6pH5N8QxBA
@JesseMarkowitz

Copy link
Copy Markdown
Contributor Author

Rebased onto the 1.4.0 release (b04100a05). Two changes, nothing else:

  • 1.4.0 took dictionary numbers 643 and 644, so this branch's strings move to 645–649.
  • 1.4.0 is released and this adds a minor changelog fragment, so StartWRT's version moves to 1.5.0.

Rust tests, bindings, web checks, formatting and the changelog checks pass on the new base.

MattDHill and others added 2 commits November 16, 2026 14:40
- The port chooser entry is "Delegate", with its icon and Manage
  Profiles' on the start side so neither collides with the checkmark.
- The confirmation is titled "Delegate <port>?", names the port in its
  body, introduces the managed switch it hands the choice to, and
  confirms with "Delegate" rather than "Trust this switch".
- Choosing a profile or Delegate no longer changes the row before the
  user confirms: the preview is built from a copy, Cancel restores the
  chooser's selection, and the table reloads once a save lands rather
  than relying on the edit it made up front.
- The inline VLAN ID list is replaced by a VLAN IDs button that opens a
  VLAN ID -> profile table, shown automatically after delegating.
- The Ethernet help is reorganized to follow the page: WAN and Not
  connected are explained under Port, Delegate replaces the Managed
  switch heading, and WAN changes are described as restarting the
  network, not the router.
- Docs, changelog fragment and all five languages follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A port counted as a trunk only while every bridge VLAN membership it held
was tagged. An untagged membership in a VLAN that belongs to no profile,
such as one added by hand in LuCI, made `ethernet.get` report the trunk as
an ordinary port, and new profiles were no longer tagged onto it.

Only profile VLANs now decide: a trunk is tagged in a profile VLAN and
untagged in none, and a VLAN of no profile is ignored. This also leaves
room for router-owned traffic that is not a profile to ride a trunk
untagged, which the access points proposed in Start9Labs#4043 would need for their
management link.

Tests: `trunk_ports` ignores a VLAN of no profile in both directions,
`ethernet.get` still reports such a port as a trunk, and creating a
profile tags it into the new VLAN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RJjVAx6ip9jA6pH5N8QxBA
@JesseMarkowitz

Copy link
Copy Markdown
Contributor Author

Added a0c4d20 on top of the UI rework: a port is now recognised as a trunk by its profile VLANs alone.

Before, an untagged membership in any bridge VLAN made ethernet.get report the trunk as an ordinary port, and new profiles were no longer tagged onto it. That included a VLAN that belongs to no profile, such as one added by hand in LuCI. Now a trunk is tagged in a profile VLAN and untagged in none, and other VLANs are ignored. This also leaves room for the access points proposed in #4043, whose management link would ride a trunk untagged.

Backend only (trunk.rs and its callers in ethernet.rs and profiles.rs), with two new tests; 970 + 37 pass. The branch now conflicts with master on the 1.4.1 version line; I'll resolve that separately, keeping 1.5.0.

@JesseMarkowitz

Copy link
Copy Markdown
Contributor Author

I've installed this PR on my home network and am testing it now.

What's running: the PR head as of today, a0c4d20 ("recognise a trunk by its profile VLANs alone"), which includes Matt's UI commit 5cb985f. It's built locally into a sysupgrade image for the SpacemiT K1 using the repo's own OpenWrt build, unmodified: the branch's version is 1.5.0 and the UI reports 1.5.0 with build a0c4d20. It replaced my previous build of this branch (1.3.0 plus the trunk work), which had been my main router since October. The update was a normal sysupgrade with settings kept, so on first boot it applied the eight migrations added since 1.3.0 (9–16) to a real, lived-in configuration, and all of them completed.

Setup: a Start9 StartWRT router (k1) as the main router, with its one LAN port delegated to a managed switch. That trunk carries Admin plus five profiles out to four 802.1Q switches, and Wi-Fi uses per-password profiles.

Before this, I did a test run on a DIY StartWRT router (Banana Pi BPI-F3) that started from the exact build and configuration the house router was running. That covered the upgrade, a rollback to the previous build (configuration came back byte-identical), the upgrade again, a reboot, and a switch on the trunk with a client moved between Admin and a profile VLAN, plus Matt's Ethernet page on real hardware.

Proposed changes for Start9Labs#4628. Extend the existing trunk lifecycle coverage and correct the switch guide's undo and physical-trust guarantees. This review proposal has not been built or tested.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed a0c4d2007912f41db40e4d5a4c0be0bdd937dda3. Requesting changes:

  1. [P1] Preserve Admin connectivity when the last trunk goes away — projects/start-wrt/backend/ctrl/src/ethernet.rs:705–706,743–765. With Admin as the only profile, delegating a port moves lan onto br-lan.1. Changing that trunk into WAN through the UI leaves the former WAN port with profile: null. With no remaining trunk or non-Admin profile, needs_vlan_filtering becomes false, the old VLAN sections are removed, and VLAN 1 is not recreated. lan still names br-lan.1, stranding the LAN gateway/management interface after reload. An API request clearing the last trunk with profile: null reaches the same failure. The proposal retains VLAN 1 while lan uses its VLAN device and extends the existing test across trunk removal and a trunk-to-WAN swap; it also removes the stale flat-bridge explanation.

  2. [P2] Undo must reconfigure both ends of the link — projects/start-wrt/docs/src/managed-switch.md:207–210. Returning the router port to a profile does not ignore the switch's configuration. Following this guide leaves the switch uplink tagged in the profile VLANs and untagged/PVID 4000; the router's now-untagged replies land in that parking VLAN instead of reaching the device ports. The proposal describes an isolated switch reconfiguration/reset before reconnecting, including its management address when the target profile changes.

  3. [P2] Limit the laptop test's security claim to untagged traffic — projects/start-wrt/docs/src/managed-switch.md:29–35,165. A laptop receiving no DHCP response on an uplink does not establish that a stranger's device gets no access. A VLAN-capable host connected to the trunk can select VLAN 1 and reach Admin without the switch password. That is inherent in the intended trunk contract, not a reason to remove tagged Admin. The proposal corrects the analogous factory-reset claims, explicitly requires physical protection of trunks, and records that trust boundary in trunk.rs.

Merge gate: git merge-tree --write-tree origin/master HEAD reports conflicts in Cargo.lock and projects/start-wrt/backend/ctrl/Cargo.toml. Please merge origin/master and resolve them before re-requesting review, retaining the minor version and master's unrelated updates.

Proposed changes: a0c4d20...proposal/4628

The proposal is source-only and unverified; I did not build, test, typecheck, or run the change. The only check currently exposed on the PR is the successful metadata-edit check. Author verification of adopted changes remains required.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

JesseMarkowitz and others added 2 commits November 18, 2026 14:44
Follow-up to the review proposal acdb8dc, which keeps VLAN 1 while `lan`
uses `br-lan.1`.

- ethernet.rs: keep a short note on why only a flat bridge may skip an
  empty VID-1 section. The proposal removed the old comment with its stale
  first half; the reason the section must stay once filtering is on (the
  router's own `br-lan.1` and the Admin SSID's runtime AP ports) still
  holds.
- trunk.rs: keep "which profile a device lands in is the switch's
  decision" alongside the new trust note: anything that can send tagged
  frames on a trunk can select any profile, Admin included.
- managed-switch.md, Undoing It: return the switch to its factory layout,
  every used port untagged in VLAN 1 with PVID 1 and the management VLAN
  left at 1, so its settings page stays reachable on the router port's
  profile. A new address follows the same rules as the plan (outside the
  profile's DHCP range), and the old reservation is replaced.
- Run the repo formatter over the new test (`make start-wrt-format-check`
  flagged three `set(...).await.unwrap()` lines).

Verified: the new `set_trunk_lifecycle_preserves_admin_vlan` test fails
with the `lan_uses_vlan1` term removed and passes with it; full
startwrt-core, uciedit and uciedit_macros suites pass (970 + 37, at
opt-level 0 as in earlier runs); `make start-wrt-format-check` clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RJjVAx6ip9jA6pH5N8QxBA
Brings in master through 09ed246, including StartWRT's changes since
1.4.0 (the RPC transport rework, its authentication, request-limit and
number-precision fixes, and localized release notes).

Conflicts: only the StartWRT version, in projects/start-wrt/backend/ctrl/
Cargo.toml and Cargo.lock. Kept 1.5.0: the latest stable release is 1.4.0
and this branch adds a minor changelog fragment, so 1.4.1 would fail
`changelog.mjs check-version` (checked against Start9's tags both ways).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RJjVAx6ip9jA6pH5N8QxBA
@JesseMarkowitz

Copy link
Copy Markdown
Contributor Author

Thanks for the review. All three points are addressed, and master is merged in.

  • P1: I took your commit acdb8dc as is. Your new test fails with the lan_uses_vlan1 term removed (VLAN 1 is gone after the trunk is cleared) and passes with it. It also covers Admin Wi-Fi: once filtering is on, the VID-1 section is what keeps the Admin SSID's ports on the bridge. bb76cf8 keeps a short version of that explanation in ethernet.rs, and make start-wrt-format-check needed three lines of the new test reformatted.

  • P2: as proposed, with one change. The undo puts the switch back in VLAN 1, untagged, PVID 1, with the management VLAN left at 1, so its settings page stays reachable whatever profile the router port gets. A new address follows the planning rules, and the old reservation is replaced.

  • P3: as proposed. trunk.rs keeps "which profile a device lands in is the switch's decision" alongside the new trust note.

The merge resolves only the version conflict: it keeps 1.5.0, which changelog.mjs check-version accepts against the 1.4.0 tag (1.4.1 fails). On the merged tree: Rust tests pass (992 + 37, 1 ignored), bindings regenerate with no drift, and check:wrt, check:i18n:wrt, prettier, rustfmt and the web build all pass.

@JesseMarkowitz

Copy link
Copy Markdown
Contributor Author

24-hour results: the build from my last comment (a0c4d20, 1.5.0) ran as my main router for a full day with no problems.

A wired machine on a profile VLAN, behind one of the switches, checked every 15 seconds: a full-size ping to the router (1522-byte tagged frames on the trunk), internet, DNS, the web UI, and all six VLANs on the trunk. About 4,900 samples, zero failures, no reboot, no service restarts, no link drops. Wi-Fi clients on both bands landed in the right profiles, Matt's Ethernet page showed the trunk correctly, and the migrations changed only what 1.4.0 intends.

Since then I've pushed 8f1ef70: Helix's review fixes plus master merged in (version kept at 1.5.0). Those changes only affect a router whose only profile is Admin, so the result above still applies to my setup. Tests, bindings, web checks and the web build all pass on the merged tree.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 8f1ef70e56031824fa52b28624fc6fcd02bc47f6. All three earlier findings are addressed. VLAN 1 survives last-trunk removal and trunk-to-WAN reassignment; the undo instructions reconfigure both ends; and the guide and production contract distinguish untagged rejection from physical access to a trusted trunk. The merge preserves master's unrelated updates and merges cleanly with current origin/master.

Product choices retained for final review: Every trunk carries Admin, with no per-trunk opt-out. Anyone able to send tagged frames on that physical link can reach every profile. An Admin opt-out would reduce that exposure but require another carried profile for switch management and an additional setting. USB ports are refused as trunks in both the API and chooser because tagged full-size operation has not been verified on adapters; allowing them would extend support beyond the recorded hardware evidence.

Brief

  • The Ethernet chooser gains Delegate, a port-specific trust confirmation, and a Managed switch state with a VLAN IDs dialog. The dialog opens after delegation and can be reopened from the row. Cancel leaves the saved layout unchanged. Existing devices remain listed under their learned profile.
  • This extends OpenWrt's existing bridge-VLAN configuration rather than adding a separate trunk registry. Ethernet assignment and profile creation share trunk recognition and membership construction. New profiles automatically join trunks on the router; their VLANs still need configuring on the switch. Returning to an ordinary port requires changing the switch configuration too.
  • The Ethernet port API adds Port.trunk, defaulting to false when omitted. Existing configurations require no migration. Invalid combinations—trunk plus profile, WAN, or USB—return error 1027. Separately, explicit profile VLAN IDs now reject another profile's ID, including Admin's on a flat bridge. Reserved/out-of-range IDs return error 1028.
  • The K1 driver patch allows full-size tagged frames by programming a 1526-byte maximum at MTU 1500. The feature also adds the managed-switch guide, TP-Link notes, translated help, and changelog fragments; StartWRT moves to 1.5.0 for the minor feature.

Implementation diff: +465 / −89 lines in 23 files (excludes lockfiles, tests, docs, release notes, and changelog). Runtime help/translations and kernel patch syntax are included; patch prose/comments are excluded.

Verification

The author reports 992 + 37 passing Rust tests, one ignored, on the merged tree; the lifecycle regression fails without the VLAN-retention condition. Bindings regenerated without drift, and web/i18n checks, formatting and the web build passed. Earlier reported Rust runs used optimization level 0 rather than the repository's default 3. Recorded K1/BPI-F3 switch and firmware-upgrade evidence covers earlier feature heads, not the final teardown fix on hardware.

My execution was limited to the Node 24 demo build and browser capture of the final UI with mock data. The build succeeded with bundle-size/CommonJS warnings; no router, kernel or unit tests were run during review. Current screenshots follow in a screenshot-only comment; the author's description explicitly labels its older screenshots as predating the UI rework.

Current-head Automated Tests, StartWRT, Build Products and Conflict Markers workflow runs report action_required, with no job/check results. This approval is a code-review verdict, not a claim that CI passed.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-white

Copy link
Copy Markdown
Member

Final UI at 8f1ef70, captured from the demo build with mock ports/profiles.

Ethernet chooser: Delegate is available on a built-in port.

Port-specific delegation and trust confirmation.

VLAN IDs dialog opened after delegation.

Saved Managed switch state with its VLAN IDs button.

@JesseMarkowitz

Copy link
Copy Markdown
Contributor Author

Hardware check of 8f1ef70 on a bench router, covering the P1 case: Admin as the only profile, with the trunk removed. Admin stayed on the router. A laptop got an Admin address and could reach the router both over the now-untagged port and over the Admin SSID. Setting the port to Admin by name and putting the trunk back also worked, and restoring a backup brought the original configs back unchanged.

Brings in master through 9a68123, including StartWRT's changes since
the last merge: factory reset from the FDL button, the CLI sign-in and
browser enrollment work, the kernel and certificate refresh, and the
Wi-Fi fixes for the MT7916 and for USB Ethernet adapters.

Conflicts: only the five StartWRT translation dictionaries. Master's
sign-in work (Start9Labs#4832) added two strings at IDs 645 and 646, where this
branch's seven managed-switch strings began. Kept master's two as they
are and renumbered this branch's to 647 through 653 in every language.
The strings themselves are unchanged.

The StartWRT version stays 1.5.0, the same as master.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RJjVAzGbCYLrG2GK1Q2aq7
@JesseMarkowitz

Copy link
Copy Markdown
Contributor Author

Master is merged in again (through 9a68123), so the PR is mergeable.

The only conflict was in the five translation dictionaries: #4832 added two strings at IDs 645 and 646, where this branch's seven strings began. I kept master's two and renumbered mine to 647 through 653. The strings themselves are unchanged, and nothing else needed a hand edit.

Checked on the merged tree: the Rust tests, the API bindings (no drift), check:wrt, check:i18n:wrt, prettier, rustfmt, the web build, and check-version against Start9's tags (1.5.0, same as master).

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 92d851c8119efd5bb2c936f0a578fa48d84439c2. The latest merge preserves the fixes from my earlier review. Its manual resolutions consistently move the seven managed-switch strings to IDs 647–653 across all five languages while retaining master's sign-in strings. Their wording and the Ethernet UI are unchanged. git merge-tree confirms a clean merge with current origin/master; I found no new correctness issue.

Updated brief

  • Delegate on the Ethernet page turns a built-in port into a tagged link carrying every profile, including Admin. A confirmation explains the switch's authority, and VLAN IDs shows the switch's required configuration. USB and WAN ports cannot be trunks. Anyone who can send tagged traffic on the physical trunk can reach every carried profile; physical protection and correct switch configuration remain essential.
  • Port.trunk extends the Ethernet API and defaults to false when omitted. Existing UCI bridge-VLAN memberships remain the source of truth, shared between Ethernet assignment and profile creation; no separate trunk registry or configuration migration is added. New profiles automatically join router-side trunks. Removing the last trunk preserves the Admin VLAN while the LAN interface uses it, and undo instructions cover reconfiguring the switch too.
  • Additional fixes reject duplicate/reserved explicit profile VLAN IDs and program the K1 MAC to accept full-size tagged frames, using a 1526-byte limit at MTU 1500. Guides, translated help and changelog fragments accompany the feature in the pending 1.5.0 release; master now already has that version.

Implementation diff: +464 / −88 lines in 22 files (excludes lockfiles, tests, docs, release notes, and changelog). Runtime help/translations and kernel patch syntax are included; patch prose/comments are excluded.

Verification evidence: The author reports Rust suites, no-drift bindings, web/i18n checks, formatting, the web build and version checks passing on the latest merged tree. The author also tested the Admin-only trunk-removal fix on hardware at 8f1ef70e5: the laptop retained Admin access over both the untagged Ethernet port and Admin SSID, and re-enabling the trunk and backup restoration worked. That hardware evidence predates the latest master merge, including its kernel refresh.

I ran no builds or tests in this re-review. The previously captured Node 24 demo screenshots below still represent the unchanged managed-switch controls. At inspection, formatting, changelog/version and the current conflict-marker checks had passed; the riscv64 build, Rust suites and generated-binding checks were still running. CI is not yet fully verified.

Managed-switch UI screenshots, reused from the earlier review

Ethernet chooser with Delegate

Port-specific delegation and trust confirmation

VLAN IDs dialog

Saved Managed switch state and VLAN IDs button

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@dr-bonez
dr-bonez merged commit 2a7fbd8 into Start9Labs:master Nov 23, 2026
28 of 29 checks passed
@JesseMarkowitz
JesseMarkowitz deleted the managed-switch-support branch November 23, 2026 19:00
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.

4 participants