@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.
@@ -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).
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: troubleshoot-network
3
+ title: Intelligent root-cause diagnosis
4
+ description: Autonomously investigate a network problem across connectivity, routing, firewall, NAT, DHCP, DNS, and system resources — ranked hypotheses with fix commands.
5
+ arguments:
6
+ - name: symptom
7
+ description: Describe the problem in plain language (e.g. "users on VLAN 20 can't reach the internet", "BGP session to 10.0.0.1 keeps dropping").
8
+ required: true
9
+ - name: scope
10
+ description: Limit investigation to specific dimensions (comma-separated). Options — connectivity, interfaces, routing, firewall, nat, dhcp, dns, resources, logs, vpn. Omit for full investigation.
11
+ required: false
12
+ ---
13
+
14
+ Investigate a network problem on this MikroTik device using the intelligent
15
+ root-cause analyzer. It autonomously probes across up to 10 dimensions and
16
+ correlates evidence into ranked hypotheses.
17
+
18
+ Symptom: {{symptom}}
19
+ Investigation scope: {{scope}}
20
+
21
+ Follow this workflow:
22
+
23
+ 1. **Automated diagnosis.** Call `diagnose` with the symptom description (and
24
+ optional scope). It will autonomously investigate connectivity, interfaces,
25
+ routing (BGP/OSPF), firewall, NAT, ARP/DHCP, DNS, CPU/memory, logs, and VPN —
26
+ then return ranked root-cause hypotheses with confidence levels.
27
+
28
+ 2. **Review hypotheses.** Present each hypothesis with:
29
+ - Confidence level (high/medium/low).
30
+ - The evidence that supports it.
31
+ - The specific fix command(s) provided.
32
+
33
+ 3. **Deep-dive if needed.** For the top hypothesis:
34
+ - If routing is involved, call `trace_path` for hop-by-hop path analysis.
35
+ - If logs suggest cascading failures, call `correlate_events` to surface the
36
+ chain (e.g. interface down → OSPF neighbor lost → route withdrawn).
37
+
38
+ 4. **Quick fix option.** Call `suggest_fix` for a condensed list of actionable
39
+ commands with one-line explanations — useful when you just need the fix
40
+ without the full diagnostic report.
41
+
42
+ 5. **Apply fix (with approval).** Present the recommended fix commands and apply
43
+ only after the user approves. Use Safe Mode for firewall changes.
44
+
45
+ Do not apply any changes without user approval.
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: upgrade-firmware
3
+ title: Upgrade RouterOS firmware safely
4
+ description: Check for updates, capture a health baseline, stage packages, and apply the upgrade with automatic rollback on failure.
5
+ arguments:
6
+ - name: channel
7
+ description: Update channel — "stable", "long-term", or "testing". Default is the device's current channel.
8
+ required: false
9
+ ---
10
+
11
+ Upgrade this MikroTik device's RouterOS firmware safely. The upgrade pipeline
12
+ captures a health baseline before upgrading so you can verify the device is
13
+ healthy afterwards — and RouterOS will automatically fall back to the previous
14
+ version if the upgrade fails.
15
+
16
+ Update channel: {{channel}}
17
+
18
+ Follow these steps in order:
19
+
20
+ 1. **Check for updates.** Call `firmware_check` to discover available versions,
21
+ compare against the current version, and assess upgrade readiness (CPU load,
22
+ free memory, version jump size). If no update is available, report that and
23
+ stop.
24
+
25
+ 2. **Capture a restore point.** Call `capture_config_snapshot` with
26
+ `label=pre-upgrade` to store the current `/export` locally. This is your
27
+ rollback reference — zero footprint on the device's flash.
28
+
29
+ 3. **Review the upgrade plan.** Present: current version → target version, the
30
+ version jump (major/minor/patch), and any readiness warnings from step 1.
31
+ Confirm with the user before proceeding.
32
+
33
+ 4. **Stage the packages.** Call `firmware_stage` to pre-download the update
34
+ packages without rebooting. This lets you verify the download succeeds before
35
+ committing to the reboot.
36
+
37
+ 5. **Apply the upgrade.** Call `firmware_upgrade` to install and reboot. The
38
+ device will come back on the new version. If it fails to boot, RouterOS
39
+ automatically falls back to the previous version.
40
+
41
+ 6. **Verify post-upgrade health.** Call `firmware_status` — it compares the
42
+ current system health against the pre-upgrade baseline and reports any
43
+ regressions (CPU, memory, package changes, RouterBOARD firmware status).
44
+
45
+ 7. **Confirm.** Report the old version, new version, health comparison, and
46
+ whether the RouterBOARD firmware also needs upgrading (if applicable).
47
+
48
+ Do not proceed past step 3 without user approval.