@usex/mikrotik-mcp 3.51.1 → 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/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
|
@@ -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.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-port-knocking
|
|
3
|
+
title: Hide management behind port knocking
|
|
4
|
+
description: Conceal SSH/Winbox/API behind a secret port-knock sequence that temporarily opens access from the knocking IP.
|
|
5
|
+
arguments:
|
|
6
|
+
- name: services
|
|
7
|
+
description: Which services to protect (comma-separated, e.g. "ssh,winbox,api"). Default is SSH and Winbox.
|
|
8
|
+
required: false
|
|
9
|
+
- name: knock_ports
|
|
10
|
+
description: Comma-separated port sequence for the knock (e.g. "1234,5678,9012"). If omitted, random ports are chosen.
|
|
11
|
+
required: false
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Set up port knocking on this MikroTik device to hide management services behind a
|
|
15
|
+
secret port sequence. Only IPs that complete the knock sequence get temporary
|
|
16
|
+
access — everyone else sees the ports as closed.
|
|
17
|
+
|
|
18
|
+
Services to protect: {{services}}
|
|
19
|
+
Knock port sequence: {{knock_ports}}
|
|
20
|
+
|
|
21
|
+
Steps:
|
|
22
|
+
|
|
23
|
+
1. **Check current access.** Call `list_ip_services` to see which management
|
|
24
|
+
services are enabled. Call `list_filter_rules` with `chain=input` to review
|
|
25
|
+
existing access rules.
|
|
26
|
+
|
|
27
|
+
2. **Set up the knock sequence.** Call `setup_port_knock` with the services to
|
|
28
|
+
protect and the port sequence (or let it generate random ports). This creates:
|
|
29
|
+
- Firewall address-lists that track the knock progress per source IP.
|
|
30
|
+
- Filter rules that move an IP through the stages as it hits each port.
|
|
31
|
+
- A final rule that allows access to the protected services for IPs that
|
|
32
|
+
complete the full sequence (with a timeout, typically 15 minutes).
|
|
33
|
+
- A drop rule for the protected services from all other IPs.
|
|
34
|
+
|
|
35
|
+
3. **Verify the knock.** Test that:
|
|
36
|
+
- Without knocking, the protected ports are unreachable.
|
|
37
|
+
- After sending packets to the knock ports in order, access opens.
|
|
38
|
+
- After the timeout, access closes again.
|
|
39
|
+
|
|
40
|
+
4. **Document.** Present the knock sequence clearly so administrators can save it
|
|
41
|
+
somewhere secure. Include example commands to knock from a client:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
nmap -Pn --host-timeout 100 -p PORT1 ROUTER_IP
|
|
45
|
+
nmap -Pn --host-timeout 100 -p PORT2 ROUTER_IP
|
|
46
|
+
nmap -Pn --host-timeout 100 -p PORT3 ROUTER_IP
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
5. **Safety warning.** Remind the user to keep a backup access method (e.g.
|
|
50
|
+
MAC-Telnet from a local network, or a trusted IP that bypasses the knock)
|
|
51
|
+
to avoid being locked out.
|
|
52
|
+
|
|
53
|
+
Do not apply changes without user approval.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-threat-feeds
|
|
3
|
+
title: Subscribe to threat intelligence feeds
|
|
4
|
+
description: Import external threat-intel IP blocklists into firewall address-lists with automatic scheduled updates.
|
|
5
|
+
arguments:
|
|
6
|
+
- name: feed_url
|
|
7
|
+
description: URL of the threat feed (one IP per line). If omitted, a well-known public feed will be suggested.
|
|
8
|
+
required: false
|
|
9
|
+
- name: list_name
|
|
10
|
+
description: Firewall address-list name to populate (e.g. "threat-blocklist"). Default is chosen automatically.
|
|
11
|
+
required: false
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Subscribe this MikroTik device to an external threat intelligence feed that
|
|
15
|
+
automatically imports malicious IPs into a firewall address-list and keeps it
|
|
16
|
+
updated on a schedule.
|
|
17
|
+
|
|
18
|
+
Feed URL: {{feed_url}}
|
|
19
|
+
Address-list name: {{list_name}}
|
|
20
|
+
|
|
21
|
+
Steps:
|
|
22
|
+
|
|
23
|
+
1. **Choose the feed.** If {{feed_url}} is not provided, suggest a well-known
|
|
24
|
+
public feed (e.g. Spamhaus DROP, Emerging Threats, or abuse.ch). Explain what
|
|
25
|
+
the feed contains and its update frequency.
|
|
26
|
+
|
|
27
|
+
2. **Subscribe.** Call `subscribe_threat_feed` with the feed URL and address-list
|
|
28
|
+
name. This creates a scheduled script that periodically fetches the feed and
|
|
29
|
+
imports the IPs into the specified address-list.
|
|
30
|
+
|
|
31
|
+
3. **Verify the import.** Call `list_address_lists` and check that the list exists
|
|
32
|
+
and contains entries. Report the count.
|
|
33
|
+
|
|
34
|
+
4. **Create firewall rules.** Add drop rules referencing the address-list:
|
|
35
|
+
- `create_filter_rule` in the `forward` chain: drop traffic with
|
|
36
|
+
`src-address-list={{list_name}}` or `dst-address-list={{list_name}}`.
|
|
37
|
+
- `create_filter_rule` in the `input` chain: drop incoming connections from
|
|
38
|
+
the list.
|
|
39
|
+
Use Safe Mode (`enable_safe_mode`) before adding firewall rules.
|
|
40
|
+
|
|
41
|
+
5. **Confirm the schedule.** Call `list_schedulers` to verify the update script
|
|
42
|
+
is scheduled (e.g. every 6 or 24 hours).
|
|
43
|
+
|
|
44
|
+
6. **Report.** The feed URL, address-list name, number of entries imported,
|
|
45
|
+
firewall rules created, and the update schedule.
|
|
46
|
+
|
|
47
|
+
To remove a feed later, use `remove_threat_feed`.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-vlan-network
|
|
3
|
+
title: Design and deploy VLAN segments
|
|
4
|
+
description: Create isolated VLAN segments with gateway addressing, DHCP, and inter-VLAN firewall policy — previewed before apply.
|
|
5
|
+
arguments:
|
|
6
|
+
- name: vlans
|
|
7
|
+
description: Describe the VLANs you need — e.g. "management=10, staff=20, IoT=30, guest=40" (name=VLAN-ID).
|
|
8
|
+
required: true
|
|
9
|
+
- name: trunk_interface
|
|
10
|
+
description: The interface to use as a VLAN trunk (e.g. "ether1", "bridge"). If omitted, the main bridge is used.
|
|
11
|
+
required: false
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Design and deploy a VLAN-segmented network on this MikroTik device. Each VLAN
|
|
15
|
+
gets its own subnet, gateway IP, DHCP server, and firewall isolation. All changes
|
|
16
|
+
are previewed before applying.
|
|
17
|
+
|
|
18
|
+
VLANs requested: {{vlans}}
|
|
19
|
+
Trunk interface: {{trunk_interface}}
|
|
20
|
+
|
|
21
|
+
Follow these steps — confirm the plan before applying any changes:
|
|
22
|
+
|
|
23
|
+
1. **Understand the current layout.** Call `list_interfaces`, `list_bridges`,
|
|
24
|
+
`list_ip_addresses`, and `list_dhcp_servers` to understand what exists.
|
|
25
|
+
|
|
26
|
+
2. **Design each VLAN segment.** For each VLAN in {{vlans}}, call
|
|
27
|
+
`design_network_segment` in **preview mode** with:
|
|
28
|
+
- VLAN ID and name.
|
|
29
|
+
- A subnet (auto-assigned or specified — e.g. 10.10.{vlan_id}.0/24).
|
|
30
|
+
- Gateway address (.1 in the subnet).
|
|
31
|
+
- DHCP pool range.
|
|
32
|
+
- Isolation policy (whether this VLAN can reach others).
|
|
33
|
+
|
|
34
|
+
3. **Review the plan.** Present a summary table:
|
|
35
|
+
- VLAN ID, name, subnet, gateway, DHCP range.
|
|
36
|
+
- Firewall rules that will be created for inter-VLAN isolation.
|
|
37
|
+
- Bridge/trunk configuration changes.
|
|
38
|
+
|
|
39
|
+
4. **Apply.** With user approval, run `design_network_segment` again with apply
|
|
40
|
+
mode for each VLAN.
|
|
41
|
+
|
|
42
|
+
5. **Verify.** Call `list_vlan_interfaces` to confirm VLANs are created,
|
|
43
|
+
`list_ip_addresses` for gateway IPs, `list_dhcp_servers` for DHCP, and
|
|
44
|
+
`list_filter_rules` for the isolation firewall rules.
|
|
45
|
+
|
|
46
|
+
Report the complete VLAN map and any follow-ups (e.g. switch port VLAN
|
|
47
|
+
assignments, wireless SSID-to-VLAN mappings).
|