Skip to content

Test RouterOS protocol peers from inside the container on a RouterOS host #7

Open

Description

@Amm0Bot

Follow-up to #5. Research left one vector unproven: which RouterOS protocols an agent in this container can actually observe, act as a client for, or serve as a peer for, when the container runs on RouterOS. Mapping and candidate packages: routeros-protocol-map.md.

Depends on #5 shipping the groups (all selected), so the packages exist to test.

Proposed lab

  • quickchr CHR with a paid license (faster than the free 1 Mbps cap), running app-t3code with T3APP_TOOL_GROUPS=all.
  • A T3 Code instance on orca or the Mac drives that remote T3 to run the tests against a second CHR, which acts as the RouterOS peer.
  • Repeat on one physical ARM/ARM64 device.

Measure first (decides the vpn group)

Capability set, ping_group_range, /dev/net/tun, /dev/ppp, /dev/kvm, kernel modules (wireguard, l2tp, gre, vxlan, xfrm, tun). Run each in three configurations: unprivileged, privileged=yes (RouterOS 7.24+ changelog), and devices= passthrough. Also check whether /app/set devices= keeps volumes like environment= does (lab results). Probe commands are in the protocol map.

Then per protocol tier

  • User space: centrs btest, SNMP, RADIUS/CoA, DNS/DoH, BGP active session (exabgp via uvx), NetFlow via nfcapd, syslog, MQTT.
  • Raw sockets: ping/arping, LLDP/CDP via lldpd, OSPF via bird2, PPPoE discovery, live tcpdump. Also check whether live TZSP works through tshark's udpdump extcap without capture privileges.
  • Interface/tunnel admin: WireGuard, IPsec (strongSwan), OpenVPN TCP/UDP, SSTP, L2TP(+IPsec), PPPoE session, GRE/VXLAN.
  • If tier A is denied, run the Linux peer as a QEMU guest under labs instead.

Record results per RouterOS version, arch, and container privilege, and feed them back into the README group table.

Activity

  1. Amm0Bot commented on Nov 7, 2026

    @Amm0Bot
    ContributorAuthor

    Unknown: which user and environment /container/shell uses

    From the PR #14 review: operators and agents may run t3code-tools from the router, e.g. /container/shell <app-container> cmd="t3code-tools status". Two points are unverified on RouterOS 7.25+:

    1. The uid. The image is USER node. If /container/shell runs as root, the shell gets root's capability set, not the app process's. Any capability evidence gathered through it would then overstate what T3's agents can do. Final tooling slice: five-group default, retire browser/agents-extra, drop bundled Muse, add uv/uvx and sqlite3 (#5) #14 makes t3code-tools install/prune/init re-execute as the payload owner (via setpriv) when run as root, so payloads stay node-owned either way.
    2. The environment. If HOME or T3CODE_TOOL_GROUPS differ from the app's, status reads the wrong payload root or selection.

    Proposed check on a twin: cmd="id", cmd="env" and cmd="cat /proc/self/status" (CapEff), compared with the same values read from a T3 terminal. Do this before citing any /container/shell output as capability evidence.

  2. Amm0Bot commented on Nov 8, 2026

    @Amm0Bot
    ContributorAuthor

    Explicit transfer from #5's closeout (labs matrix). These items need a RouterOS host and now belong here:

    • A nested CHR guest (x86, and ARM64 under TCG) booted by quickchr inside app-t3code on a RouterOS host. On Morpheus's CHR (1 CPU, 1 GiB, no /dev/kvm) only QEMU, firmware discovery and quickchr doctor were checked; no guest was booted.
    • quickchr file transfer, snapshots and machine cleanup on that host.
    • Real ARM64 RouterOS hardware (e.g. RDS2216). Native ARM64 Linux container runtime is already covered by CI (Implement persistent ENV-selected tool groups without blocking T3 startup #5 closeout comment).
  3. added
    research
    on Nov 8, 2026
  4. Amm0Bot commented on Nov 8, 2026

    @Amm0Bot
    ContributorAuthor

    Triage 2026-11-07, added scope from the owner's notes:

    • Privileged vs unprivileged is not a CAP_NET_ADMIN toggle. In each configuration, record the full CapEff/CapBnd, the cgroup version, the controllers and whether they can be written, the seccomp mode, and the devices present. Compare that with Docker's default and --privileged sets, so the README's privilege table is based on observation rather than mapped from Docker. The Morpheus baseline (unprivileged): CapEff 0, CapBnd 3fffffffff, Seccomp 2, /dev/net/tun present, no /dev/kvm.
    • Output feeds Skills track: baked t3code+RouterOS skills, SKILL_REPOS, harness linking, user-level AGENTS.md #17 (the Linux host as a RouterOS "twin": which tool exercises which RouterOS protocol, tested). Use the reverse quickchr setup: the container on a test CHR, a peer CHR as the target.
    • Unlicensed CHR timing and failure modes (1 Mbps cap) can ride along with this lab (Roadmap Roadmap #20, Later).
    • Any centrs or quickchr problem found here: file it in that repo (label the cross-link upstream).
  5. added 2 commits that reference this issue on Nov 8, 2026
  6. Amm0Bot commented on Nov 8, 2026

    @Amm0Bot
    ContributorAuthor

    Two test CHRs ready for this lab, and the arm64 first-install path (2026-11-08)

    From the #3 re-run (write-up in #26, docs/research/2026-11-07/chr-0.1.7-upgrade.md; recipe in .claude/skills/chr-app-lab/SKILL.md):

    • x86 test CHR (RouterOS 7.25, p-unlimited, bridged LAN): upgraded to 0.1.7 by /app/update, with all five groups ready.
    • arm64 test CHR (RouterOS 7.25.1, TCG on an x86_64 host, 2 vCPU / 2 GiB, p-unlimited, same LAN): a fresh 0.1.7 install from app/t3code.tikapp.yaml. The pull and extract took about 8 minutes, and the web UI answered 200 about 11.5 minutes after the /app PUT. All five groups reached ready in the background:
    Group Payload Time
    capture arm64-trixie-c149fa9e83498601 389 s (after one interrupted attempt, see below)
    labs arm64-trixie-b470b946f9fa8cc5 137 s (pruned 256 MiB of AAVMF secure-boot images)
    vpn arm64-trixie-3c91e98e858d15b4 65 s
    routing arm64-trixie-e490a90fc8e3b234 54 s
    dev arm64-abi137-ab2895431a557d74 118 s

    /data uses 4.5G of 24G afterwards. As expected on a fresh home, claude is missing; that's the installer bug on #13.

    For this issue:

    • /container/shell runs as uid 1000 (node), the image user, in both CHRs.
    • Every RouterOS stop is a SIGKILL, because PID 1 tini doesn't catch SIGTERM (RouterOS SIGKILLs the app on every stop: PID 1 (tini) doesn't catch SIGTERM #25). The first capture install was killed by an app restart that /app/settings router-ip triggered, and the next attempt cleaned up the staging directory. The cleanup path works on arm64.
    • Under TCG, /container/shell commands that start Bun (t3code-tools status) took over 110 s while groups installed. Plain shell commands return in seconds. Size harness timeouts for that.
  7. Amm0Bot commented on Nov 8, 2026

    @Amm0Bot
    ContributorAuthor

    Sizing signal from the arm64 TCG CHR (owner, 2026-11-08)

    On the arm64 test CHR (2 vCPU, 2 GiB, TCG on an x86_64 Mac, which may also be throttling under heat):

    • The owner changed T3CODE_TOOL_GROUPS to labs vpn dev in WinBox's app environment and pressed Apply. That restarted the container, with a SIGKILL as usual (RouterOS SIGKILLs the app on every stop: PID 1 (tini) doesn't catch SIGTERM #25). The UI came back a few minutes later, with /data unchanged (4.9 GB used before and after).
    • Right after the restart, T3 showed "Claude provider status: timed out after 25s while checking Claude account status" and "Some requests are slow: 1 request waiting longer than 15s". The background group installs were probably running at the same time. After about 5 minutes, Claude was logged in and the terminal worked.
    • WinBox showed about 62 % CPU and 1096.6 / 951.4 / 2048.0 MiB of memory during that window.
    • Pairing took about 30 s there (Pairing screen: show how to get a token from RouterOS (fork-less) #18).

    So 2 vCPU and 2 GiB under TCG works, but only just: it's the slowness a too-small router would show. For real hardware this is a data point for a minimum-size note. The first minutes after a start (T3 startup, provider probes, group installs) are the peak. Worth measuring separately on a real arm64 RouterBOARD. Also: both test CHRs now have distinct identities (t3code, t3code-arm64) instead of CHR, so T3 and WinBox can tell them apart once the containers restart.

  8. mobileskyfi commented on Nov 10, 2026

    @mobileskyfi
    Contributor

    Visible again after the Amm0Bot suspension (2026-11-08 to 2026-11-10). Updates from that gap, which the roadmap (#30) carried:

    • The /container/shell uid is answered: 1000 (node), or root with user=root; HOME is /data either way, and the umask is 0000 (measured on 7.25 x86 and 7.25.1 arm64, AGENTS.md "Users"). As root, t3app tools switches back to the payload owner (t3app: app-owned command, settings and source layout #45).
    • t3code-tools is now t3app tools, and the setting is T3APP_TOOL_GROUPS (t3app: app-owned command, settings and source layout #45). The body's research links point at the moved paths.
    • A sizing note from the arm64 TCG CHR, written for this issue while it was hidden: comment on #30.
    • The lab CHRs (x86 and arm64, same LAN) are ready for this; recipe in .agents/skills/chr-app-lab.
  9. mobileskyfi commented on Nov 24, 2026

    @mobileskyfi
    Contributor

    privileged in /app YAML: verified on CHR (2026-11-24)

    Context: while adding dns and privileged to the restraml /app schemas (tikoci/restraml#125, #126), I tested the YAML form on CHR. These are the first observations of the "Measure first" privileged vs unprivileged comparison. It isn't the full lab.

    The YAML key

    A service-level privileged: works from 7.25. Checked on 7.25.2 and 7.26beta7 by enabling each app and reading the resulting /container entry:

    YAML /container privileged=
    privileged: true or privileged: 'true' true
    privileged: false, or no key false
    privileged: yes or privileged: maybe false, with no error
    • yes doesn't work. Only true does, even though yes is how RouterOS writes booleans everywhere else.
    • 7.24.7 ignores the key. /container has a privileged= property there, but privileged: true in the YAML still produces privileged=false. So the YAML route starts at 7.25, which matches the 7.25beta4 changelog entry "allow the privileged mode to be enabled per service in the container app YAML". The body's "RouterOS 7.24+" applies to the /container privileged= setting, not to the YAML.
    • No validation at /app/add. RouterOS accepts any key there, including an unknown zzz_unknown, so being accepted proves nothing. Check /container instead.

    What changes inside the container (7.25.2 x86 CHR)

    Measured with alpine:latest running as root, read through /container/shell:

    privileged: true unprivileged
    uid 0 0
    CapEff / CapPrm / CapBnd 3fffffffff 3fffffffff
    CapEff after su nobody 0 0
    Seccomp / NoNewPrivs 2 / 0 2 / 0
    /sys/fs/cgroup read-only; controllers cpuset cpu io memory pids same
    net.ipv4.ping_group_range 1 0 (unprivileged ICMP sockets off) 65534 65534
    /dev entries 405 18
    /dev/net/tun, /dev/fuse present present
    /dev/ppp, /dev/kvm absent absent
    ip link add … type dummy / type wireguard RTNETLINK answers: Not supported same

    What this suggests (one CHR, one image):

    • Privileged mode doesn't change the capability set here. A root process already gets the full set without it, and a non-root user gets none either way. So for node (uid 1000), privileged mode alone won't grant CAP_NET_RAW or CAP_NET_ADMIN, which fits the Morpheus baseline of CapEff 0. Running as root (user=root) is the lever for capabilities, not privileged.
    • What it does change is the device list. /dev goes from 18 entries to 405, and ping_group_range changes. Without privileged mode the setting is 65534 65534, which allows unprivileged ICMP sockets only for gid 65534. With it, the setting is 1 0, which turns them off entirely. So a non-root ping could get worse in privileged mode.
    • /dev/net/tun is present even unprivileged. /dev/ppp isn't present in either mode.

    Caveats

    • This was an x86 CHR on macOS HVF, so /dev/kvm being absent says nothing about a host that has KVM.
    • ip here is BusyBox's. "Not supported" is the kernel's answer for dummy and wireguard, but it should be re-checked with iproute2 from the app-t3code image before ruling either out.
    • devices= passthrough, the T3 image's node user, and arm64 hardware weren't tested. Those still need the lab.

    The restraml /app schemas now accept privileged only as true/false/'true'/'false', so editors flag yes. Per-version schemas for 7.24.x leave the key out.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    research

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions