@usex/mikrotik-mcp 3.51.0 → 3.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/shared/{cli-22wrpg71.js → cli-ewkttc56.js} +90 -110
- package/dist/shared/{cli-dq28zbns.js → cli-thdzk64q.js} +1 -1
- package/dist/shared/{library-510csx1a.js → library-4npjv6jq.js} +1 -1
- package/dist/shared/{library-mwcpnqqg.js → library-n3yvjpkm.js} +90 -110
- package/dist/ui/observability.html +12 -12
- package/package.json +1 -1
- package/prompts/audit-security-posture.md +41 -0
- package/prompts/backup-and-document.md +10 -5
- package/prompts/choose-vpn-solution.md +3 -0
- package/prompts/design-qos-policy.md +49 -0
- package/prompts/detect-config-drift.md +51 -0
- package/prompts/diagnose-connectivity.md +15 -5
- package/prompts/disaster-recovery-drill.md +43 -0
- package/prompts/fleet-health-check.md +41 -0
- package/prompts/harden-router.md +10 -0
- package/prompts/manage-certificates.md +51 -0
- package/prompts/safe-change-workflow.md +6 -0
- package/prompts/setup-bgp-peering.md +57 -0
- package/prompts/setup-hotspot.md +52 -0
- package/prompts/setup-multi-wan.md +46 -0
- package/prompts/setup-ospf-peering.md +56 -0
- package/prompts/setup-port-knocking.md +53 -0
- package/prompts/setup-threat-feeds.md +47 -0
- package/prompts/setup-vlan-network.md +47 -0
- package/prompts/troubleshoot-network.md +45 -0
- package/prompts/upgrade-firmware.md +48 -0
package/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: audit-security-posture
|
|
3
|
+
title: Run a compliance security audit
|
|
4
|
+
description: Comprehensive security audit across SSH, services, firewall, users, DNS, certificates, SNMP, hardening, and VPN — scored A+ through F with actionable fix commands.
|
|
5
|
+
arguments:
|
|
6
|
+
- name: categories
|
|
7
|
+
description: Comma-separated categories to audit (e.g. "ssh,firewall,users"). Omit for a full audit across all 9 categories.
|
|
8
|
+
required: false
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Run a comprehensive security compliance audit on this MikroTik device. The audit
|
|
12
|
+
covers 36 checks across 9 categories — SSH, management services, firewall, user
|
|
13
|
+
accounts, DNS, certificates, SNMP, system hardening, and VPN — and scores the
|
|
14
|
+
device from A+ (excellent) down to F (critical).
|
|
15
|
+
|
|
16
|
+
Categories to audit: {{categories}}
|
|
17
|
+
|
|
18
|
+
Follow this workflow:
|
|
19
|
+
|
|
20
|
+
1. **Run the audit.** Call `run_compliance_audit` (optionally filtered to
|
|
21
|
+
`{{categories}}`). Review the per-check results: each check reports pass, fail,
|
|
22
|
+
or warn with a severity level and a specific fix command.
|
|
23
|
+
|
|
24
|
+
2. **Present the results.** Organize findings by severity (critical → low):
|
|
25
|
+
- The overall grade (A+ through F) and numeric score.
|
|
26
|
+
- A summary table of failed and warning checks.
|
|
27
|
+
- For each failing check: what it found, why it matters, and the exact fix
|
|
28
|
+
command provided by the audit engine.
|
|
29
|
+
|
|
30
|
+
3. **Remediate (with user approval).** If the user wants to fix failing checks,
|
|
31
|
+
call `audit_remediate` with `dry_run=true` first to preview what commands would
|
|
32
|
+
run. Then, with approval, call `audit_remediate` with `dry_run=false` to apply.
|
|
33
|
+
|
|
34
|
+
4. **Re-audit.** After remediation, run `run_compliance_audit` again to confirm
|
|
35
|
+
the score improved and no new issues were introduced.
|
|
36
|
+
|
|
37
|
+
5. **Fleet-wide (optional).** If multiple devices are configured, offer to run
|
|
38
|
+
`audit_fleet` for a consolidated report with aggregate scores and the most
|
|
39
|
+
common failures across the fleet.
|
|
40
|
+
|
|
41
|
+
Do not apply any fixes without user approval. Present the audit report first.
|
|
@@ -9,9 +9,12 @@ Create a restore point for this MikroTik device and then write up a clear,
|
|
|
9
9
|
human-readable summary of how it's configured. This is read-mostly: the only
|
|
10
10
|
change is creating a backup/export.
|
|
11
11
|
|
|
12
|
-
1. **
|
|
12
|
+
1. **Local snapshot (zero device footprint)** — `capture_config_snapshot` first.
|
|
13
|
+
This stores a text `/export` in the MCP host's local database — no file is
|
|
14
|
+
written on the router's flash. Give it a descriptive `label` (e.g. `pre-audit`).
|
|
15
|
+
2. **Device restore point** — `create_backup` (binary, for full restore) and
|
|
13
16
|
`create_export` (text `.rsc`, for review/diff). List them with `list_backups`.
|
|
14
|
-
|
|
17
|
+
3. **Inventory** — gather the configuration with read tools and organize it:
|
|
15
18
|
- System: `get_system_identity`, `get_system_resources`, `get_routerboard`,
|
|
16
19
|
`get_installed_packages`.
|
|
17
20
|
- L2/L3: `list_interfaces`, `list_vlan_interfaces`, `list_bridges`,
|
|
@@ -23,10 +26,12 @@ change is creating a backup/export.
|
|
|
23
26
|
`list_users`, `list_certificates`.
|
|
24
27
|
- VPN/QoS: `list_wireguard_interfaces` + `list_wireguard_peers`,
|
|
25
28
|
`list_simple_queues`, `list_queue_trees`.
|
|
29
|
+
- Containers: `list_containers` (if the container feature is enabled).
|
|
26
30
|
- Automation: `list_schedulers`, `list_scripts`.
|
|
27
31
|
|
|
28
32
|
Produce a structured Markdown report: a one-paragraph overview, a table of
|
|
29
33
|
interfaces and addressing, the firewall posture, and a "things worth reviewing"
|
|
30
|
-
section (defaults left in place, disabled-but-present rules, expiring certs
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
section (defaults left in place, disabled-but-present rules, expiring certs —
|
|
35
|
+
check `list_certificates` for any expiring within 30 days).
|
|
36
|
+
Reference the snapshot id and backup/export filenames you created so the user
|
|
37
|
+
knows their restore points.
|
|
@@ -23,6 +23,9 @@ Decision guidance — weigh these MikroTik options:
|
|
|
23
23
|
- **WireGuard** — fastest, simplest, modern. Best for MikroTik↔MikroTik and
|
|
24
24
|
laptops/phones with the WireGuard app. No built-in OS client on older systems.
|
|
25
25
|
Tools: `create_wireguard_interface`, `add_wireguard_peer`, `generate_wireguard_client_config`.
|
|
26
|
+
For **3+ sites** (full-mesh or hub-spoke): `build_wireguard_mesh`.
|
|
27
|
+
For **user onboarding** (generate config, add peer, revoke later):
|
|
28
|
+
`onboard_wireguard_user`, `revoke_wireguard_user`.
|
|
26
29
|
- **IPsec (IKEv2)** — the interoperability choice for site-to-site with
|
|
27
30
|
_other vendors_ (Cisco/Fortinet/pfSense) and for native iOS/Windows IKEv2
|
|
28
31
|
road-warrior. Most config surface. Tools: `create_ipsec_*` (profile/peer/
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-qos-policy
|
|
3
|
+
title: Design a traffic shaping policy
|
|
4
|
+
description: Build a QoS queue hierarchy from business requirements — define traffic classes, priorities, and bandwidth guarantees with preview before apply.
|
|
5
|
+
arguments:
|
|
6
|
+
- name: wan_bandwidth
|
|
7
|
+
description: WAN bandwidth in download/upload format (e.g. "100M/50M", "1G/1G").
|
|
8
|
+
required: true
|
|
9
|
+
- name: classes
|
|
10
|
+
description: Describe traffic classes and priorities (e.g. "VoIP=highest, video conferencing=high, web=normal, bulk downloads=low"). If omitted, a sensible default is used.
|
|
11
|
+
required: false
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Design and deploy a traffic shaping (QoS) policy on this MikroTik device that
|
|
15
|
+
prioritizes important traffic and prevents bulk downloads from saturating the
|
|
16
|
+
link. All changes are previewed before applying.
|
|
17
|
+
|
|
18
|
+
WAN bandwidth: {{wan_bandwidth}}
|
|
19
|
+
Traffic classes: {{classes}}
|
|
20
|
+
|
|
21
|
+
Steps:
|
|
22
|
+
|
|
23
|
+
1. **Understand the network.** Call `list_interfaces` and `list_ip_addresses` to
|
|
24
|
+
identify the WAN interface. Call `list_queue_trees` and `list_simple_queues`
|
|
25
|
+
to check if any QoS is already in place.
|
|
26
|
+
|
|
27
|
+
2. **Design the policy.** Translate {{classes}} into a queue hierarchy:
|
|
28
|
+
- A parent queue on the WAN interface capped at {{wan_bandwidth}}.
|
|
29
|
+
- Child queues for each traffic class with appropriate priorities,
|
|
30
|
+
guaranteed minimum bandwidth, and burst settings.
|
|
31
|
+
Call `apply_traffic_shaping` in **preview mode** to see the queue tree
|
|
32
|
+
structure before applying.
|
|
33
|
+
|
|
34
|
+
3. **Review the queue tree.** Present a table showing:
|
|
35
|
+
- Each traffic class, its priority level, guaranteed bandwidth, max bandwidth.
|
|
36
|
+
- Packet marks or connection marks used to classify traffic.
|
|
37
|
+
- Mangle rules that mark traffic into classes.
|
|
38
|
+
|
|
39
|
+
4. **Apply.** With user approval, deploy the QoS policy.
|
|
40
|
+
|
|
41
|
+
5. **Verify.** Call `list_queue_trees` to confirm the hierarchy is in place.
|
|
42
|
+
Monitor briefly to see traffic flowing through the queues.
|
|
43
|
+
|
|
44
|
+
6. **Capacity planning (optional).** Call `forecast_link_saturation` on the WAN
|
|
45
|
+
interface to project when the current link will reach capacity at the observed
|
|
46
|
+
growth rate — useful for planning upgrades.
|
|
47
|
+
|
|
48
|
+
Report the complete QoS policy: queue hierarchy, classification rules, and
|
|
49
|
+
bandwidth allocations per class.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: detect-config-drift
|
|
3
|
+
title: Detect and resolve config drift
|
|
4
|
+
description: Compare live router config against a golden baseline, identify who changed what and when, then roll back or accept the drift.
|
|
5
|
+
arguments:
|
|
6
|
+
- name: action
|
|
7
|
+
description: What to do — "check" (detect drift), "reconcile" (roll back to baseline), or "promote" (accept drift as new baseline). Default is "check".
|
|
8
|
+
required: false
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Work with the Config Drift Guardian on this MikroTik device. The drift system
|
|
12
|
+
compares the live `/export` against a stored golden baseline and reports exactly
|
|
13
|
+
what changed, who changed it (from system logs), and scores the severity 0–100.
|
|
14
|
+
|
|
15
|
+
Requested action: {{action}}
|
|
16
|
+
|
|
17
|
+
Follow the workflow for the requested action:
|
|
18
|
+
|
|
19
|
+
**If checking (or no action specified):**
|
|
20
|
+
|
|
21
|
+
1. **Verify baseline exists.** Call `config_check_drift`. If it reports "no
|
|
22
|
+
baseline set", guide the user to set one first with `config_set_baseline`
|
|
23
|
+
(captures the current config as the known-good reference).
|
|
24
|
+
|
|
25
|
+
2. **Review the drift report.** Present:
|
|
26
|
+
- Drift score (0–100) and overall status (in-sync or drifted).
|
|
27
|
+
- Per-section breakdown: which RouterOS sections changed and by how much.
|
|
28
|
+
- Change attribution: who made each change and when (from system logs).
|
|
29
|
+
- The unified diff showing exact added/removed lines.
|
|
30
|
+
|
|
31
|
+
3. **Recommend next steps.** Based on the drift:
|
|
32
|
+
- If changes are intentional → suggest `config_promote_drift` to accept.
|
|
33
|
+
- If changes are unwanted → suggest `config_reconcile` to roll back.
|
|
34
|
+
|
|
35
|
+
**If reconciling:**
|
|
36
|
+
|
|
37
|
+
1. Call `config_reconcile` with `confirm=false` first (dry-run). This replays the
|
|
38
|
+
baseline commands in Safe Mode and then rolls back, showing what would change.
|
|
39
|
+
2. Review the dry-run output with the user.
|
|
40
|
+
3. With approval, call `config_reconcile` with `confirm=true` to commit. Safe Mode
|
|
41
|
+
ensures automatic rollback if the device becomes unreachable.
|
|
42
|
+
|
|
43
|
+
**If promoting:**
|
|
44
|
+
|
|
45
|
+
1. Call `config_promote_drift` to accept the current live config as the new golden
|
|
46
|
+
baseline. Optionally provide a `label` and `notes` explaining why the drift is
|
|
47
|
+
being accepted.
|
|
48
|
+
2. Confirm the new baseline ID and that the old baseline is preserved in snapshot
|
|
49
|
+
history.
|
|
50
|
+
|
|
51
|
+
Always explain the consequences before taking action.
|
|
@@ -15,6 +15,11 @@ Troubleshoot a connectivity issue on a MikroTik RouterOS device, reasoning from
|
|
|
15
15
|
the bottom of the stack up. Use read-only tools only — do not change config until
|
|
16
16
|
you've localized the fault and the user approves a fix.
|
|
17
17
|
|
|
18
|
+
**Quick alternative:** for a fully automated diagnosis, call `diagnose` with the
|
|
19
|
+
symptom description — it autonomously investigates across 10 dimensions and
|
|
20
|
+
returns ranked root-cause hypotheses with fix commands. Use the manual steps below
|
|
21
|
+
when you need more control or the automated diagnosis needs a deeper look.
|
|
22
|
+
|
|
18
23
|
Target that is unreachable: {{target}}
|
|
19
24
|
Affected segment/interface: {{source_interface}}
|
|
20
25
|
|
|
@@ -24,16 +29,21 @@ Diagnose in layers, stating what each step rules in or out:
|
|
|
24
29
|
PoE/SFP links check status. `get_interface` for details.
|
|
25
30
|
2. **Addressing** — `list_ip_addresses`; confirm the segment has a valid gateway
|
|
26
31
|
IP and the WAN has an address (DHCP/PPPoE/static).
|
|
27
|
-
3. **
|
|
32
|
+
3. **ARP & DHCP** — `list_dhcp_servers` and `list_dhcp_leases` on the affected
|
|
33
|
+
segment; confirm clients are getting leases and ARP is resolving.
|
|
34
|
+
4. **Routing** — `get_routing_table`, then `check_route_path` toward {{target}} to
|
|
28
35
|
see which route/gateway would be used and whether it's active.
|
|
29
|
-
|
|
36
|
+
5. **Name resolution** — if {{target}} is a hostname, `resolve_dns` and
|
|
30
37
|
`get_dns_settings`.
|
|
31
|
-
|
|
38
|
+
6. **Reachability** — `ping` {{target}} from the router (and with `src_address`
|
|
32
39
|
set to the segment's gateway if relevant); `traceroute` to find where it stops.
|
|
33
|
-
|
|
40
|
+
7. **Firewall / NAT** — `list_filter_rules` and `list_nat_rules`; look for a drop
|
|
34
41
|
in `forward` or a missing `srcnat`/masquerade for the segment. Check
|
|
35
42
|
`list_address_lists` if rules reference one.
|
|
36
|
-
|
|
43
|
+
8. **Logs & event correlation** — `search_logs` for the interface/subnet and
|
|
44
|
+
`get_system_events`. If multiple log entries suggest cascading failures (e.g.
|
|
45
|
+
interface down → OSPF neighbor lost → route withdrawn), use `correlate_events`
|
|
46
|
+
to surface the chain.
|
|
37
47
|
|
|
38
48
|
Conclude with the single most likely root cause, the evidence for it, and the
|
|
39
49
|
specific tool call(s) that would fix it (for the user to approve).
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: disaster-recovery-drill
|
|
3
|
+
title: Rehearse a disaster recovery scenario
|
|
4
|
+
description: Simulate a failure in Safe Mode, verify the backup/restore path works, then auto-revert — proving your DR plan without risk.
|
|
5
|
+
arguments:
|
|
6
|
+
- name: scenario
|
|
7
|
+
description: What failure to simulate (e.g. "lose WAN interface", "delete all firewall rules", "disable OSPF", "remove default route"). If omitted, a sensible scenario will be chosen.
|
|
8
|
+
required: false
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Rehearse a disaster recovery scenario on this MikroTik device **without any
|
|
12
|
+
lasting impact**. The drill uses RouterOS Safe Mode to simulate a failure, verify
|
|
13
|
+
the backup and restore path works, then auto-revert everything. This proves your
|
|
14
|
+
DR plan actually works — safely.
|
|
15
|
+
|
|
16
|
+
Scenario to simulate: {{scenario}}
|
|
17
|
+
|
|
18
|
+
Follow these steps:
|
|
19
|
+
|
|
20
|
+
1. **Take a restore point.** Call `capture_config_snapshot` with
|
|
21
|
+
`label=pre-dr-drill` so you have a reference even outside Safe Mode.
|
|
22
|
+
|
|
23
|
+
2. **Run the drill.** Call `run_failover_drill` with the scenario description.
|
|
24
|
+
The drill will:
|
|
25
|
+
- Enter Safe Mode (all changes auto-revert if something goes wrong).
|
|
26
|
+
- Apply the simulated failure (e.g. disable the WAN interface).
|
|
27
|
+
- Assess the impact: what broke, what services are affected.
|
|
28
|
+
- Verify the recovery path: can the backup restore the state?
|
|
29
|
+
- Auto-revert all changes — the device returns to its pre-drill state.
|
|
30
|
+
|
|
31
|
+
3. **Review the drill report.** Present:
|
|
32
|
+
- What was simulated and what broke as a result.
|
|
33
|
+
- Whether the backup/restore path would have recovered the device.
|
|
34
|
+
- Time to recovery (how long the revert took).
|
|
35
|
+
- Any gaps in the DR plan (e.g. no backup exists, restore would miss X).
|
|
36
|
+
|
|
37
|
+
4. **Recommendations.** Based on the drill results, suggest improvements:
|
|
38
|
+
- Missing backups or snapshots to create.
|
|
39
|
+
- Configuration changes that would improve resilience.
|
|
40
|
+
- Monitoring or alerting to add (e.g. netwatch for the WAN link).
|
|
41
|
+
|
|
42
|
+
The drill is **non-destructive** — Safe Mode ensures everything reverts. Report
|
|
43
|
+
the full drill outcome and recommendations.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fleet-health-check
|
|
3
|
+
title: Fleet-wide health and compliance sweep
|
|
4
|
+
description: Check reachability, resource usage, firmware currency, security posture, and config drift across all configured devices.
|
|
5
|
+
arguments: []
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Run a comprehensive health and compliance sweep across **all configured MikroTik
|
|
9
|
+
devices** accessible through this server. This is a read-only operation — no
|
|
10
|
+
changes are made.
|
|
11
|
+
|
|
12
|
+
Steps:
|
|
13
|
+
|
|
14
|
+
1. **List all devices.** Call `list_devices` to get every configured device and
|
|
15
|
+
its connection status.
|
|
16
|
+
|
|
17
|
+
2. **Per-device health check.** For each reachable device (pass `device=<name>`
|
|
18
|
+
on each tool call):
|
|
19
|
+
- **System resources:** `get_system_resources` — CPU load, memory usage, disk
|
|
20
|
+
usage, uptime. Flag any device above 80% CPU or memory.
|
|
21
|
+
- **Firmware currency:** `firmware_check` — is an update available? How far
|
|
22
|
+
behind is the installed version?
|
|
23
|
+
- **Security posture:** `run_compliance_audit` — get the A+ through F grade
|
|
24
|
+
and count of critical/warning findings.
|
|
25
|
+
- **Config drift:** `config_check_drift` — if a golden baseline is set, report
|
|
26
|
+
whether the device has drifted and the severity score. Skip if no baseline.
|
|
27
|
+
|
|
28
|
+
3. **Fleet summary.** Present a consolidated report:
|
|
29
|
+
- A table with one row per device: name, status, CPU%, memory%, firmware
|
|
30
|
+
version, update available, compliance grade, drift status.
|
|
31
|
+
- **Alerts:** devices with critical resource usage, outdated firmware, poor
|
|
32
|
+
compliance scores, or unresolved drift.
|
|
33
|
+
- **Prioritized actions:** what to address first (e.g. "device-X has an F
|
|
34
|
+
security grade — run the hardening prompt", "device-Y is 3 versions behind —
|
|
35
|
+
run the firmware upgrade prompt").
|
|
36
|
+
|
|
37
|
+
4. **Unreachable devices.** List any devices that couldn't be reached and suggest
|
|
38
|
+
troubleshooting steps (check SSH connectivity, credentials, network path).
|
|
39
|
+
|
|
40
|
+
This is a reporting-only sweep. Recommend specific prompts or tools for each
|
|
41
|
+
finding but do not make changes.
|
package/prompts/harden-router.md
CHANGED
|
@@ -33,6 +33,16 @@ Carry out a hardening pass in this order, explaining each finding:
|
|
|
33
33
|
bandwidth-test left open on the WAN.
|
|
34
34
|
6. **DNS** — `get_dns_settings`; if `allow-remote-requests` is yes, ensure UDP/TCP
|
|
35
35
|
53 from WAN is dropped.
|
|
36
|
+
7. **SSH hardening** — `get_ssh_server_settings`; recommend strong-crypto only,
|
|
37
|
+
disable password auth if SSH keys are already deployed for admin users, and
|
|
38
|
+
consider changing the default port.
|
|
39
|
+
8. **Automated DDoS / brute-force protection** — consider `harden_firewall` (the
|
|
40
|
+
Security Shield) to deploy rate-limiting rules for SSH/Winbox brute-force,
|
|
41
|
+
SYN floods, port scans, and IP spoofing in one step.
|
|
42
|
+
9. **Full compliance audit** — for a comprehensive automated check across all 36
|
|
43
|
+
security dimensions, run `run_compliance_audit`. It scores the device A+
|
|
44
|
+
through F and provides per-check fix commands. Use this to catch anything the
|
|
45
|
+
manual steps above may have missed.
|
|
36
46
|
|
|
37
47
|
Finish with a short prioritized checklist (Critical / Recommended / Optional) and
|
|
38
48
|
the exact tool calls you would run for each. Do not make changes the user hasn't
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: manage-certificates
|
|
3
|
+
title: Manage TLS certificates and Let's Encrypt
|
|
4
|
+
description: Audit certificate expiry, issue or renew Let's Encrypt certificates via ACME, and deploy them to services.
|
|
5
|
+
arguments:
|
|
6
|
+
- name: domain
|
|
7
|
+
description: Domain name for Let's Encrypt issuance (e.g. "router.example.com"). Required for issuing new certificates.
|
|
8
|
+
required: false
|
|
9
|
+
- name: action
|
|
10
|
+
description: What to do — "audit" (check expiry), "issue" (new Let's Encrypt cert), or "renew" (renew expiring certs). Default is "audit".
|
|
11
|
+
required: false
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Manage TLS certificates on this MikroTik device — audit expiry dates, issue new
|
|
15
|
+
certificates via Let's Encrypt (ACME), and deploy them to services.
|
|
16
|
+
|
|
17
|
+
Domain: {{domain}}
|
|
18
|
+
Action: {{action}}
|
|
19
|
+
|
|
20
|
+
Follow the workflow for the requested action:
|
|
21
|
+
|
|
22
|
+
**If auditing (or no action specified):**
|
|
23
|
+
|
|
24
|
+
1. Call `audit_certificate_expiry` to scan all installed certificates. It reports
|
|
25
|
+
each certificate's subject, issuer, expiry date, and days remaining.
|
|
26
|
+
2. Flag any certificates expiring within 30 days as **urgent**, within 90 days as
|
|
27
|
+
**warning**.
|
|
28
|
+
3. For expiring certificates, recommend renewal — either via ACME for Let's
|
|
29
|
+
Encrypt certs, or manual replacement for CA-signed certs.
|
|
30
|
+
4. Call `list_certificates` for a full inventory including self-signed and CA certs.
|
|
31
|
+
|
|
32
|
+
**If issuing a new certificate:**
|
|
33
|
+
|
|
34
|
+
1. Confirm {{domain}} resolves to this router's public IP (for HTTP-01 challenge).
|
|
35
|
+
2. Ensure port 80 is accessible from the internet (check `list_nat_rules` and
|
|
36
|
+
`list_filter_rules` for port 80).
|
|
37
|
+
3. Call `request_letsencrypt_certificate` with the domain name.
|
|
38
|
+
4. Verify issuance with `list_certificates` — the new cert should appear with
|
|
39
|
+
the Let's Encrypt issuer.
|
|
40
|
+
5. Deploy the cert to the relevant service (e.g. `set_ip_service` for www-ssl,
|
|
41
|
+
or configure it for SSTP/OpenVPN).
|
|
42
|
+
|
|
43
|
+
**If renewing:**
|
|
44
|
+
|
|
45
|
+
1. Call `audit_certificate_expiry` to identify which certs need renewal.
|
|
46
|
+
2. For each expiring Let's Encrypt cert, call `request_letsencrypt_certificate`
|
|
47
|
+
with the same domain to renew.
|
|
48
|
+
3. Verify renewal with `list_certificates`.
|
|
49
|
+
4. Recommend setting up a scheduler script for automatic renewal (e.g. monthly).
|
|
50
|
+
|
|
51
|
+
Report all certificate changes and service assignments.
|
|
@@ -43,5 +43,11 @@ Follow these steps in order — never skip the snapshot.
|
|
|
43
43
|
`get_config_snapshot` (it returns the full `/export` `.rsc` text) and use it to
|
|
44
44
|
reverse the change.
|
|
45
45
|
|
|
46
|
+
6. **Set a golden baseline (optional).** If the change is intentional and
|
|
47
|
+
permanent, call `config_set_baseline` to designate the new state as the
|
|
48
|
+
golden-config baseline. Future drift can then be detected automatically with
|
|
49
|
+
`config_check_drift` — it reports exactly what changed, who changed it (from
|
|
50
|
+
system logs), and scores the severity.
|
|
51
|
+
|
|
46
52
|
Report: the snapshot id you captured, the plan summary, the committed diff, and
|
|
47
53
|
the post-change verification result.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-bgp-peering
|
|
3
|
+
title: Set up BGP peering
|
|
4
|
+
description: Configure a BGP connection to a peer — upstream provider, IX, or another router — with templates, filters, and session verification.
|
|
5
|
+
arguments:
|
|
6
|
+
- name: peer_address
|
|
7
|
+
description: Neighbor IP address (e.g. "198.51.100.1").
|
|
8
|
+
required: true
|
|
9
|
+
- name: remote_as
|
|
10
|
+
description: Peer AS number (e.g. "65000").
|
|
11
|
+
required: true
|
|
12
|
+
- name: local_as
|
|
13
|
+
description: Local AS number. If omitted, defaults to the existing BGP AS or the router-id-based AS.
|
|
14
|
+
required: false
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
Configure a BGP peering session on this MikroTik device. This sets up the BGP
|
|
18
|
+
template, connection, and verification. Confirm the plan before applying.
|
|
19
|
+
|
|
20
|
+
Peer address: {{peer_address}}
|
|
21
|
+
Remote AS: {{remote_as}}
|
|
22
|
+
Local AS: {{local_as}}
|
|
23
|
+
|
|
24
|
+
Steps:
|
|
25
|
+
|
|
26
|
+
1. **Check existing BGP config.** Call `list_bgp_templates` and
|
|
27
|
+
`list_bgp_connections` to see if BGP is already configured. Call
|
|
28
|
+
`list_ip_addresses` to confirm we have a local IP in the same subnet as the
|
|
29
|
+
peer (or a route to reach it).
|
|
30
|
+
|
|
31
|
+
2. **Create a BGP template.** Call `add_bgp_template` with:
|
|
32
|
+
- `as={{local_as}}` (or the existing AS).
|
|
33
|
+
- Address families (typically `ip` for IPv4 unicast; add `ipv6` if needed).
|
|
34
|
+
- Hold time, keepalive, and other timers as appropriate.
|
|
35
|
+
|
|
36
|
+
3. **Create the BGP connection.** Call `add_bgp_connection` with:
|
|
37
|
+
- `remote.address={{peer_address}}`
|
|
38
|
+
- `remote.as={{remote_as}}`
|
|
39
|
+
- `local.role` — set to `ebgp` for external peers, `ibgp` for internal.
|
|
40
|
+
- Link to the template created in step 2.
|
|
41
|
+
|
|
42
|
+
4. **Firewall.** Ensure TCP port 179 (BGP) is allowed from {{peer_address}} in
|
|
43
|
+
the `input` chain. Call `create_filter_rule` using Safe Mode.
|
|
44
|
+
|
|
45
|
+
5. **Verify the session.** Call `list_bgp_sessions` — the session should reach
|
|
46
|
+
`established` state. If it stays in `connect` or `active`, check:
|
|
47
|
+
- Firewall rules on both sides.
|
|
48
|
+
- IP reachability (`ping` {{peer_address}}).
|
|
49
|
+
- AS number and address-family mismatch.
|
|
50
|
+
|
|
51
|
+
6. **Check routes.** Call `list_bgp_advertisements` to see what this router is
|
|
52
|
+
advertising. Call `list_routes` to see BGP-learned routes from the peer.
|
|
53
|
+
|
|
54
|
+
7. **Routing filters (optional).** If you need to filter incoming or outgoing
|
|
55
|
+
prefixes, set up routing filter rules to accept/reject specific prefixes.
|
|
56
|
+
|
|
57
|
+
Report the session status, routes received/advertised, and any warnings.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-hotspot
|
|
3
|
+
title: Build a captive portal hotspot
|
|
4
|
+
description: Deploy a complete guest hotspot with captive portal, DHCP, per-user bandwidth limits, and optional voucher codes.
|
|
5
|
+
arguments:
|
|
6
|
+
- name: interface
|
|
7
|
+
description: The interface for the hotspot (e.g. "wlan1", "ether5", "vlan-guest"). This is where guest clients connect.
|
|
8
|
+
required: true
|
|
9
|
+
- name: dns_name
|
|
10
|
+
description: DNS name for the captive portal (e.g. "hotspot.local"). Optional.
|
|
11
|
+
required: false
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Deploy a complete captive-portal hotspot on this MikroTik device. The hotspot
|
|
15
|
+
will have its own DHCP, gateway, bandwidth limits, and optional voucher-based
|
|
16
|
+
access. Confirm the plan before applying changes.
|
|
17
|
+
|
|
18
|
+
Hotspot interface: {{interface}}
|
|
19
|
+
Portal DNS name: {{dns_name}}
|
|
20
|
+
|
|
21
|
+
Steps:
|
|
22
|
+
|
|
23
|
+
1. **Check the interface.** Call `get_interface` for {{interface}} to confirm it
|
|
24
|
+
exists and is running. For a wireless interface, verify an SSID is set with
|
|
25
|
+
`list_wireless_interfaces`.
|
|
26
|
+
|
|
27
|
+
2. **Build the hotspot.** Call `build_guest_hotspot` with:
|
|
28
|
+
- The interface ({{interface}}).
|
|
29
|
+
- A gateway subnet (e.g. 10.5.50.1/24).
|
|
30
|
+
- DHCP pool for clients.
|
|
31
|
+
- Per-user bandwidth limits (e.g. 5M download / 2M upload).
|
|
32
|
+
- The DNS name for portal redirect ({{dns_name}} if provided).
|
|
33
|
+
This creates the IP address, DHCP server, hotspot instance, and profile in
|
|
34
|
+
one step.
|
|
35
|
+
|
|
36
|
+
3. **Generate vouchers (optional).** Call `generate_hotspot_vouchers` to create
|
|
37
|
+
time-limited or usage-limited access codes. Present the voucher codes in a
|
|
38
|
+
table with their limits and expiry.
|
|
39
|
+
|
|
40
|
+
4. **Walled garden.** If the portal needs to allow access to specific sites
|
|
41
|
+
without login (e.g. a terms page, payment gateway), add walled-garden entries.
|
|
42
|
+
|
|
43
|
+
5. **Firewall.** Verify the hotspot network is isolated from the management and
|
|
44
|
+
internal networks — the hotspot setup should handle this, but confirm with
|
|
45
|
+
`list_filter_rules`.
|
|
46
|
+
|
|
47
|
+
6. **Test.** Verify the portal redirect works — a client connecting to
|
|
48
|
+
{{interface}} should be redirected to the login page before getting internet
|
|
49
|
+
access.
|
|
50
|
+
|
|
51
|
+
Report the hotspot configuration: gateway, DHCP range, bandwidth limits, voucher
|
|
52
|
+
codes (if generated), and the portal URL.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-multi-wan
|
|
3
|
+
title: Set up multi-WAN failover or load balancing
|
|
4
|
+
description: Configure resilient multi-WAN with health-checked active-passive failover or ECMP load balancing across two or more uplinks.
|
|
5
|
+
arguments:
|
|
6
|
+
- name: wan_interfaces
|
|
7
|
+
description: Comma-separated WAN interface names (e.g. "ether1,ether2" or "ether1,lte1").
|
|
8
|
+
required: true
|
|
9
|
+
- name: mode
|
|
10
|
+
description: "failover" for active-passive with health checks, or "loadbalance" for ECMP. Default is failover.
|
|
11
|
+
required: false
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Set up multi-WAN resilience on this MikroTik device so it stays online even when
|
|
15
|
+
a link goes down. Confirm the plan with the user before applying changes.
|
|
16
|
+
|
|
17
|
+
WAN interfaces: {{wan_interfaces}}
|
|
18
|
+
Mode: {{mode}}
|
|
19
|
+
|
|
20
|
+
Steps:
|
|
21
|
+
|
|
22
|
+
1. **Inventory the WANs.** Call `list_interfaces` and `list_ip_addresses` to
|
|
23
|
+
confirm each WAN interface exists, is running, and has an address (static,
|
|
24
|
+
DHCP, or PPPoE). Note each WAN's gateway.
|
|
25
|
+
|
|
26
|
+
2. **Deploy the multi-WAN setup.**
|
|
27
|
+
- For **failover**: call `setup_wan_failover` with the WAN interfaces. This
|
|
28
|
+
creates health-check routes (pinging reliable targets like 1.1.1.1 and
|
|
29
|
+
8.8.8.8) and distance-based route priorities — the secondary WAN activates
|
|
30
|
+
only when the primary's health check fails.
|
|
31
|
+
- For **load balancing**: call `setup_wan_loadbalance` with the WANs. This
|
|
32
|
+
creates ECMP routes that spread traffic across both uplinks, with health
|
|
33
|
+
checks to pull a dead link out of the pool automatically.
|
|
34
|
+
|
|
35
|
+
3. **Firewall / NAT.** Ensure each WAN has a masquerade/srcnat rule so outbound
|
|
36
|
+
traffic uses the correct source address. Check `list_nat_rules`.
|
|
37
|
+
|
|
38
|
+
4. **Verify failover.** Test by temporarily disabling the primary WAN interface
|
|
39
|
+
and confirming traffic switches to the secondary:
|
|
40
|
+
- `ping` 8.8.8.8 continuously from the router.
|
|
41
|
+
- `disable_interface` on the primary WAN, verify ping continues via secondary.
|
|
42
|
+
- `enable_interface` to restore it.
|
|
43
|
+
- Check `get_routing_table` to confirm route priorities are correct.
|
|
44
|
+
|
|
45
|
+
5. **Report.** The WAN priority order, health check targets, failover timing,
|
|
46
|
+
and NAT rules for each WAN.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-ospf-peering
|
|
3
|
+
title: Set up OSPF dynamic routing
|
|
4
|
+
description: Configure OSPF instances, areas, and interface templates for dynamic route exchange between MikroTik routers.
|
|
5
|
+
arguments:
|
|
6
|
+
- name: router_id
|
|
7
|
+
description: The OSPF router ID for this device (e.g. "10.0.0.1"). Typically a loopback or management IP.
|
|
8
|
+
required: true
|
|
9
|
+
- name: area
|
|
10
|
+
description: OSPF area ID (e.g. "0.0.0.0" for backbone, "0.0.0.1" for a stub area). Default is backbone.
|
|
11
|
+
required: false
|
|
12
|
+
- name: interfaces
|
|
13
|
+
description: Which interfaces to run OSPF on (comma-separated, e.g. "ether1,ether2,bridge"). If omitted, you'll be asked.
|
|
14
|
+
required: false
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
Configure OSPF dynamic routing on this MikroTik device so it automatically
|
|
18
|
+
exchanges routes with neighboring OSPF routers. Confirm the plan before applying.
|
|
19
|
+
|
|
20
|
+
Router ID: {{router_id}}
|
|
21
|
+
OSPF area: {{area}}
|
|
22
|
+
Interfaces: {{interfaces}}
|
|
23
|
+
|
|
24
|
+
Steps:
|
|
25
|
+
|
|
26
|
+
1. **Inventory.** Call `get_system_identity`, `list_interfaces`, and
|
|
27
|
+
`list_ip_addresses` to understand the device topology. Call
|
|
28
|
+
`list_ospf_instances` to check if OSPF is already configured.
|
|
29
|
+
|
|
30
|
+
2. **Create the OSPF instance.** Call `add_ospf_instance` with:
|
|
31
|
+
- `router_id={{router_id}}`
|
|
32
|
+
- Redistribution settings if needed (e.g. redistribute connected, static).
|
|
33
|
+
|
|
34
|
+
3. **Create the area.** Call `add_ospf_area` with the area ID ({{area}} or
|
|
35
|
+
`0.0.0.0` for backbone). For stub areas, set `type=stub`.
|
|
36
|
+
|
|
37
|
+
4. **Add interface templates.** For each interface in {{interfaces}}, call
|
|
38
|
+
`add_ospf_interface_template` with:
|
|
39
|
+
- The interface name and area.
|
|
40
|
+
- Network type (broadcast for Ethernet, point-to-point for tunnels).
|
|
41
|
+
- Cost if you want to influence path selection.
|
|
42
|
+
- Authentication if required (MD5 or simple password).
|
|
43
|
+
|
|
44
|
+
5. **Firewall.** Ensure OSPF traffic is allowed — add a `create_filter_rule` in
|
|
45
|
+
the `input` chain accepting protocol 89 (OSPF) on the relevant interfaces.
|
|
46
|
+
Use Safe Mode for firewall edits.
|
|
47
|
+
|
|
48
|
+
6. **Verify adjacency.** Wait a few seconds, then call `list_ospf_neighbors` to
|
|
49
|
+
confirm the neighbor relationship reaches `Full` state. If stuck in
|
|
50
|
+
`ExStart` or `2-Way`, check MTU, area, and authentication match.
|
|
51
|
+
|
|
52
|
+
7. **Check routes.** Call `list_routes` and filter for OSPF routes to confirm
|
|
53
|
+
remote subnets are being learned.
|
|
54
|
+
|
|
55
|
+
Report the OSPF instance, area, interface assignments, neighbor status, and
|
|
56
|
+
learned routes.
|