Lab setup

Welcome — connect your lab

New here? This short guide saves router login, optional VPN provider credentials (same env names as mtk init-site), and mtk-serve URL into ~/.mtk/dashboard-workspace.json on this machine (file mode 0600). You can store multiple named profiles and switch the active one below. Proxy-only testing still works if you skip router fields but set mtk-serve.

1 · What you’ll need

  • Router (MikroTik) — LAN IP (often 192.168.88.1), SSH user (usually admin), and password.
  • mtk-serve — Base URL for the testing API (default http://127.0.0.1:8765) and token if your server requires auth.
  • VPN (optional) — Provider username/password for L2TP; used when you bootstrap slots / run mtk with site JSON that references env:MTK_VPN_USER.

Already use shell env vars? You can skip this wizard — your environment is left as-is until you save here.

Seeing 403 / wrong API in DevTools? Open the URL printed by mtk dashboard start (default 8766). Port 8765 is usually mtk-serve, not this dashboard — paths like /api/network/conditions exist only on the dashboard.

Profiles on this machine

Load workspace, pick active profile, save. Add more profiles by running the wizard again with a new name or edit JSON carefully.

Live proxy traffic

HTTP requests through mtk-serve (same as proxy log). Shows method, path, status, latency, and whether traffic was mocked or passed through. Filter by client IP in Settings → WebSocket filter.

Waiting for events…

Quick Actions

Run Scenario

Execute pre-built test flows like geo-blocking, offline recovery, error resilience

🔴 Start Recording

Capture HTTP traffic for replay testing or golden file comparison

🔗 SDK Connect

Full visibility: pipeline status, tab playbooks, and copy-ready Python / CLI / REST for every action

📖 View Documentation

Interactive guides with animated diagrams and code examples

📋 Traffic & activity

Open Network tab for a full traffic log while you shape links — verify requests still appear

Session activity

Timeline of actions from this session. Expand SDK snippet on any row for copy-ready Python / REST. Open SDK Connect for the full playbook and last mirrored code.

No actions yet — apply a network profile or add a proxy rule.
Loading connection status…

The router applies limits per IP. Each card below can show a different badge — that is how you see different devices on different settings. Pick one device, change it here; others keep their own rules until you reset them.

Applied on router

Conditions load from the dashboard API (same as the All active tab). Use Sync after Reset if the banner lags.

Preset

Profile for the editing device only.

Custom

Bandwidth, latency, loss for this IP.

Kbps
Kbps
ms
ms
%

Timed disconnect

Temporary block (separate from offline preset).

sec

Reset on router

Removes queues and firewall rules for this IP (or everyone). Fixes stuck "offline" if the banner still shows a condition after you expected it cleared.

Link cockpit

Visual summary for the editing device — same data as the API, no extra tab.

Select a device to see its limits.
Live throughput (polls router)
Download
Limit: —
Upload
Limit: —
📦
Bytes
Packets: —
🚫
Dropped
Packets: —

Validation (configured vs router)

Start live polling to validate
SettingConfiguredRouterStatus
Apply a profile and start live polling

Generate traffic on the device to see rates move.

Advanced: raw stats & firewall dump

                    
                    
                  

Preset atlas

Cards show each profile. Target is the device selected on Workbench.

Target:
Loading presets…

All active conditions

Every IP the dashboard sees with shaping. Click an IP to jump back to Workbench.

Loading…

Session inspector

HTTP transactions recorded by mtk-serve. Device list follows Workbench LAN refresh.

Setup
  1. Same Wi‑Fi as this machine.
  2. System proxy: phone → manual proxy → this PC’s IP, port 8888. Trust CA: http://<PC-IP>:8888/ca.crt
  3. Passthrough: http://<PC-IP>:8765/v1/proxy/to/<host>/<path>
  4. Health: curl http://<PC-IP>:8765/healthz
Updates every 1.5s
No snapshot

Session list is empty

Press Fetch or enable Live after the device uses the proxy.

DNS Control

Redirect domains to the proxy for interception, or block them entirely. Supports wildcards like *.example.com.

Active Rules

Loading…

Create proxy rule

Rule presets

Save bundles of rules on this browser and apply them in one step — built for recurring test personas (geo mocks, outage paths, slow APIs). Starters work out of the box; use Target device IP for rules that don’t hard-code a client.

Filled automatically from Proxy filter or Override client when empty.

Save a bundle — loads current rules from mtk-serve (same as Load rules & logs without filter).

Active rules

Click Load

Recent HTTP log

Click “Load rules & logs”

Test Scenarios

One-click test flows combining network, DNS, and proxy actions. Perfect for testing app resilience.

Built-in Scenarios

Scenario Execution Log

Run a scenario to see execution log

Traffic Recording

Record HTTP traffic from a device, then replay it to create mock responses.

Idle Ready to record

Recorded Sessions

No recordings yet

Replay Session

Create proxy override rules from a recorded session to mock responses for a device.

Configuration Profiles

Profiles from MTK_PROFILES_DIR. Applies network, DNS, proxy, and VPN settings defined in YAML.

Profile Actions

Select a profile to see details

SDK Connect — SQA visibility

Treat this dashboard as a living spec: see what each subsystem is doing, then drop the same calls into pytest, CI, or scripts. Below: live bridge health, per-tab cookbook, mirrored snippets from your last successful action, and how this maps to REST.

Live bridge

Your browser talks to this dashboard (/api/*, /ws). The dashboard uses MtkTestKit, which reaches MikroTik over SSH and mtk-serve over HTTP (/v1/*).

Current tab playbook

Python
CLI
REST (dashboard or mtk-serve)

Last mirrored action

Interact with controls — successful actions publish copy-ready code here.


        
        
      

pytest fixture shape

Drop mirrored lines inside test_example; keep mtk as your single entry point.


      

Dashboard API surface

These routes power the UI — equivalent kit calls are in the playbooks. mtk-serve exposes /v1/proxy/*, /v1/network/*, etc.

MethodPathArea
GET/api/setup/statusFirst-run / workspace status (no secrets)
GET/api/setup/suggest-routerLAN gateway + SSH probe → suggested router IP
GET/POST/api/setup/workspaceLoad or save local credential profiles
GET/POST/api/setup/env-uiCurated MTK_* toggles (saved as env_ui in workspace)
GET/api/healthRouter + mtk-serve probe
GET/api/overviewCounts + proxy snapshot
GET/wsLive ticks + log lines
POST/api/network/applyThrottle / profile / latency / loss
GET/api/network/lan-devicesDHCP leases + ARP neighbors (device picker)
GET/api/network/conditionsList active clients
GET/api/network/live-stats?client_ip=...Real queue/firewall counters from router
POST/api/dns/redirectAdd redirect
GET/api/dns/redirectsList
POST/api/proxy/ruleOverride / error / delay
GET/api/proxy/certs/statusmtk-serve MITM CA + leaf metadata
POST/api/proxy/certs/importInstall CA PEM + key on mtk-serve (HTTPS MITM)
GET/api/proxy/logsHTTP request log
POST/api/scenarios/runYAML scenario
POST/api/recording/startBegin HAR capture
POST/api/profiles/applyYAML bundle apply

Connection Status

MikroTik Router Checking...
mtk-serve Proxy Checking...

HTTPS decoding (MITM CA)

mtk-serve uses a CA + private key to decrypt TLS for the proxy log (Charles-style). Below is what is installed on mtk-serve today — not your whole macOS keychain. Install the same CA on test devices to trust HTTPS.

CA on mtk-serve now

Loading certificate info from mtk-serve…

Install or replace CA

One bundle file (e.g. Charles root-ca.p12). Enter the export password if the tool set one.

Charles usually encrypts the export — use the password you chose. Blank only if the bundle has no password.

Quick Actions

Preferences

Theme Switch between dark and light mode
WebSocket Filter Filter real-time logs to specific client
Export State Download current dashboard state as JSON
Refresh All Data Reload from router and mtk-serve

Environment

Toggle common MTK_* flags for this dashboard process (saved in your workspace as env_ui). mtk-serve still uses the environment from how you launched it — restart it after changing server-side variables.

Loading…
Loading...