Xpersona
M

Mikrotik Routeros

CLAWHUB · Unverified

Expert-level management of MikroTik RouterOS devices and VSOL GPON OLTs via SSH or RouterOS API (port 8728/8729) and REST API (port 80/443). Use this skill w... Skill: Mikrotik Routeros Owner: charllesvale Summary: Expert-level management of MikroTik RouterOS devices and VSOL GPON OLTs via SSH or RouterOS API (port 8728/8729) and REST API (port 80/443). Use this skill w... Tags: cgnat:1.0.0, failover:1.0.0, gpon:1.0.0, isp:1.0.0, latest:2.0.5, mikrotik:1.0.0, olt:1.0.0, pppoe:1.0.0, routeros:1.0.0 Version history: v2.0.5 | 2026-04-19T13:17:14.537Z | auto - Skill renamed from

62
Rank
84
Safety
971
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 971 downloads reported by the source. Last updated 10/12/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17b9ddyv8zzse6ax5b3d1kcjn84jtbx:mikrotik-routeros-isp
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-charllesvale-mikrotik-routeros-isp/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

145,148 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: mikrotik-routeros-isp-br
description: >
  Expert-level management of MikroTik RouterOS devices and VSOL GPON OLTs via SSH or
  RouterOS API (port 8728/8729) and REST API (port 80/443).
  Use this skill whenever the user mentions MikroTik, RouterOS, RB, CCR, CRS, hAP,
  Winbox CLI, /ip route, /interface, /ppp, /queue, firewall rules, OSPF, BGP, VRRP,
  PPPoE, CGNAT, RADIUS, VLAN, OLT, GPON, ONT, PON port, or any ISP infrastructure task.
  Also triggers for: "show MikroTik routes", "configure PPPoE on RB4011",
  "check OLT uptime", "add firewall rule", "backup RouterOS config",
  "failover script", "notificação de link caído", "alerta Telegram MikroTik",
  "WhatsApp failover", "Evolution API RouterOS", "netwatch script",
  "script de failover com WhatsApp", "load balance actions",
  "conectar na API do MikroTik", "listar interfaces via API",
  "multi-device mikrotik", "TOOLS.md mikrotik",
  "netwatch-notify eworm", "backup upload mikrotik", "check-health routeros",
  "telegram-chat routeros", "dhcp-to-dns mikrotik", "eworm scripts routeros".
tags:
  - mikrotik
  - routeros
  - gpon
  - olt
  - isp
  - pppoe
  - cgnat
  - failover
  - api
requirements:
  binaries:
    - ssh
    - sshpass
  env:
    - MIKROTIK_HOST: "IP or hostname of the MikroTik device"
    - MIKROTIK_USER: "RouterOS username (default: admin)"
    - MIKROTIK_PASS: "(optional) password — prefer SSH key auth instead"
    - MIKROTIK_KEY: "(optional) path to SSH private key (default: ~/.ssh/mikrotik_key)"
    - OLT_HOST: "(optional) IP of VSOL/GPON OLT"
    - OLT_USER: "(optional) OLT SSH username"
    - OLT_PASS: "(optional) OLT SSH password"
security:
  credentials: >
    Prefer SSH key authentication over passwords. When password is needed,
    use MIKROTIK_PASS env var — never hardcode in scripts or TOOLS.md.
    Create a least-privilege management account on devices, not full admin.
  external_urls:
    - api.telegram.org — Telegram bot notifications (optional)
    - rsc.eworm.de — eworm RouterOS scripts (optional, audit before use)
    - Evolution API — WhatsApp notifications (optional, self-hosted)
---

# MikroTik RouterOS + VSOL OLT Skill

Expert-level management of MikroTik RouterOS devices and VSOL GPON OLTs.
Supports three access methods: **SSH CLI**, **RouterOS API (port 8728)**, and **REST API (port 443)**.
Covers ISP-grade infrastructure: PPPoE, CGNAT, RADIUS, VLAN, OSPF, BGP, VRRP, firewall,
queues, OLT/ONT provisioning, failover scripts, and WhatsApp/Telegram notifications.

---

## Access Method Selection

| Method | When to use | Port |
|--------|-------------|------|
| SSH CLI | Interactive config, scripts, export/import | 22 |
| RouterOS API | Automation, programmatic reads/writes, Python scripts | 8728/8729 |
| REST API | Modern ROS 7.1+, curl/HTTP clients, no extra library | 80/443 |

---

## Multi-Device Configuration

### Via TOOLS.md (recommended for multi-device setups)
Add to `~/.openclaw/workspace/TOOLS.md`:
```markdown
### MikroTik Devices
- **rou

_meta.json

{
  "ownerId": "kn71hqzwzv59bb4n0nxr7gej3984kh96",
  "slug": "mikrotik-routeros-isp",
  "version": "2.0.5",
  "publishedAt": 1776604634537
}

references/eworm-scripts.md

# eworm-de/routeros-scripts — Referência Completa
> GitHub: https://github.com/eworm-de/routeros-scripts
> GitLab: https://gitlab.com/eworm-de/routeros-scripts
> Docs: https://rsc.eworm.de/main/
> 1.8k ⭐ · GPL v3 · Mantido desde 2013 por Christian Hesse

Framework de scripts de produção em RouterOS puro.
**Requer RouterOS 7.17+** para o framework global-functions completo.

---

## Instalação do Framework Base

### 1. Certificado HTTPS

```routeros
# RouterOS 7.19+ — usa builtin trust anchors
/certificate/settings/set builtin-trust-anchors=trusted

# RouterOS < 7.19 — importa manualmente
/tool/fetch "https://rsc.eworm.de/main/certs/Root-YE.pem" dst-path="root-ye.pem"
/certificate/import file-name="root-ye.pem" passphrase=""
/certificate/set name="Root-YE" [ find where common-name="Root YE" ]
# Verifica fingerprint:
/certificate/print proplist=name,fingerprint \
  where fingerprint="e14ffcad5b0025731006caa43a121a22d8e9700f4fb9cf852f02a708aa5d5666"
```

### 2. Scripts base (obrigatórios)

```routeros
:foreach Script in={ "global-config"; "global-config-overlay"; "global-functions" } do={
  /system/script/add name=$Script owner=$Script \
    source=([ /tool/fetch check-certificate=yes-without-crl \
    ("https://rsc.eworm.de/main/" . $Script . ".rsc") output=user as-value ]->"data");
}
/system/script { run global-config; run global-functions; }
```

### 3. Scheduler de boot

```routeros
# Carrega config e funções no boot
/system/scheduler/add name="global-scripts" start-time=startup \
  on-event="/system/script { run global-config; run global-functions; }"

# Auto-update diário dos scripts (opcional)
/system/scheduler/add name="ScriptInstallUpdate" start-time=startup interval=1d \
  on-event=":global ScriptInstallUpdate; \$ScriptInstallUpdate;"
```

### 4. Instalar scripts

```routeros
# Um script
$ScriptInstallUpdate netwatch-notify

# Vários de uma vez
$ScriptInstallUpdate check-routeros-update,check-health,backup-upload,mod/notification-telegram
```

---

## Catálogo Completo de Scripts

### 💾 Backup

| Script | Função |
|--------|--------|
| `backup-cloud` | Upload de backup para MikroTik Cloud |
| `backup-email` | Envia backup por e-mail |
| `backup-partition` | Salva config na partição fallback (dual-boot) |
| `backup-upload` | Upload de backup para servidor via SCP/FTP |

```routeros
$ScriptInstallUpdate backup-upload
# Configurar destino no global-config-overlay:
# :global BackupUploadUrl "sftp://user:pass@servidor/path/"
# :global BackupSendBinary true
# :global BackupSendExport true

/system/scheduler/add name=backup-upload interval=1d start-time=startup \
  on-event="/system/script/run backup-upload;"
```

---

### 🔔 Monitoramento & Saúde

| Script | Função |
|--------|--------|
| `check-health` | Notifica sobre saúde do sistema (CPU, RAM, temp, tensão) |
| `check-routeros-update` | Notifica quando há atualização de RouterOS disponível |
| `check-certificates` | Renova e notifica sobre expiração de certificados |
| `check-lte-firmware-u

references/failover-notifications.md

# Failover Actions + Notificações (Telegram, WhatsApp, Google Sheets)

Scripts para monitorar links e enviar alertas automáticos quando ocorre failover.
Compatível com Netwatch (V6/V7), rota flutuante e load balance.

---

## Como funciona

O RouterOS detecta queda/subida de link via **Netwatch** ou **rota flutuante**.
Nos eventos `ifdown` / `ifup`, ele seta variáveis globais e chama o script de actions.

### Variáveis globais usadas pelos scripts

| Variável | Quem seta | Descrição |
|----------|-----------|-----------|
| `$comentario` | netwatch / rota | Nome do link (ex: "FIBRA PRINCIPAL") |
| `$LinkState` | netwatch / rota | `1` = UP, `0` = DOWN |
| `$LinkStatus` | FAILOVER_ACTIONS | Texto "UP" ou "DOWN" |
| `$emoji` | FAILOVER_ACTIONS | 🟢 (UP) ou 🔴 (DOWN) |
| `$botToken` | script | Token do bot Telegram |
| `$groupID` | script | Chat ID do Telegram |
| `$urlGoogleSheets` | script | URL do Apps Script (Google Sheets) |

---

## Integração com Netwatch

### RouterOS V6 — ifdown / ifup
```routeros
/ip/netwatch/add host=8.8.8.8 interval=5s timeout=1s \
    down-script=":global comentario \"FIBRA PRINCIPAL\"; :global LinkState 0; /system script run FAILOVER_ACTIONS" \
    up-script=":global comentario \"FIBRA PRINCIPAL\"; :global LinkState 1; /system script run FAILOVER_ACTIONS"
```

### RouterOS V7 — ifdown / ifup
```routeros
/ip/netwatch/add host=8.8.8.8 interval=5s timeout=1s \
    down-script=":global comentario \"FIBRA PRINCIPAL\"; :global LinkState 0; execute {/system script run FAILOVER_ACTIONS}" \
    up-script=":global comentario \"FIBRA PRINCIPAL\"; :global LinkState 1; execute {/system script run FAILOVER_ACTIONS}"
```

> V7: use `execute { }` em vez de chamar direto — garante contexto limpo de execução.

---

## Script FAILOVER_ACTIONS — Telegram + Google Sheets

### Versão V6 (comando sem `/`)
```routeros
/system script
add name=FAILOVER_ACTIONS policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
source={
#=======================================================================
# =============== VARIAVEIS GERAIS =====================================
#=======================================================================
:global comentario
:global LinkStatus
:global LinkState
:local LinkStateActions $LinkState
:global emoji
:global routerName [/system identity get name]
:if ($LinkStateActions > 0) do={:global emoji "%F0%9F%9F%A2"; :global LinkStatus "UP"} \
    else={:global emoji "%F0%9F%94%B4"; :global LinkStatus "DOWN"}

#=======================================================================
#=============== GERAR LOG =============================================
#=======================================================================
/log warning message=("LINK: $comentario -- STATUS: $LinkStatus ")

#=======================================================================
#=============== ENVIO DE AVISO NO TELEGRAM ============================
#==============================================================

references/isp-stack.md

# ISP Stack Reference — OLT → MikroTik → RADIUS

Full end-to-end configuration for a FTTH ISP using VSOL OLT + MikroTik PPPoE concentrator + MK-Auth RADIUS.

---

## Architecture

```
[ONT/CPE] ─── GPON ──→ [VSOL OLT]
                           │ VLAN 500–507 per PON port (tagged)
                           ▼
                    [MikroTik RB4011 / CCR]
                    PPPoE Server (per VLAN)
                    CGNAT Pool: 100.64.0.0/10
                    RADIUS → MK-Auth
                           │ SNAT via loopback
                           ▼
                    [MikroTik CCR1009]
                    Border / BGP / Transit
```

---

## MikroTik — VLAN Bridge Setup (per PON port)

```routeros
# Bridge for upstream (trunk)
/interface bridge add name=br-uplink

# VLAN interfaces per PON port
/interface vlan add name=vlan500 vlan-id=500 interface=ether2-olt comment="PON1"
/interface vlan add name=vlan501 vlan-id=501 interface=ether2-olt comment="PON2"
# ... repeat for 502–507

# PPPoE server on each VLAN
/interface pppoe-server server
add name=pppoe-pon1 interface=vlan500 service-name=internet authentication=pap,chap disabled=no
add name=pppoe-pon2 interface=vlan501 service-name=internet authentication=pap,chap disabled=no
```

---

## MikroTik — RADIUS (MK-Auth)

```routeros
/radius
add address=<mkauth-ip> secret=<shared-secret> service=ppp timeout=3000ms

/ppp profile
set default use-radius=yes

/ppp aaa
set use-interim-update=yes interim-update=5m
```

---

## MikroTik — CGNAT Pool

```routeros
/ip pool
add name=cgnat-pool ranges=100.65.62.0-100.65.63.255

/ppp profile
set default local-address=100.64.0.1 remote-address=cgnat-pool
```

---

## MikroTik — SNAT via Loopback (CCR1009)

```routeros
# Loopback IPs (one per CCR for SNAT source)
/ip address add address=10.255.0.1/32 interface=lo comment="SNAT-1"
/ip address add address=10.255.0.2/32 interface=lo comment="SNAT-2"

# SNAT rule on CCR border
/ip firewall nat
add chain=srcnat src-address=100.64.0.0/10 \
    action=src-nat to-addresses=10.255.0.1 \
    out-interface=ether1-transit comment="CGNAT SNAT"
```

---

## GenieACS / TR-069 Integration

- GenieACS runs on `<server>:7547` (CWMP) and `<server>:3000` (UI)
- CPEs must have ACS URL set to `http://<genieacs-ip>:7547`
- MikroTik can provision via `/tool fetch` or TR-069 on supported models

---

## MK-Auth Integration Notes

- MK-Auth runs PPPoE + Hotspot RADIUS
- Default RADIUS port: 1812 (auth) / 1813 (acct)
- Shared secret configured in MK-Auth → Configurações → RADIUS
- User plans map to MK-Auth "planos" with speed limits pushed via RADIUS attributes (Mikrotik-Rate-Limit)

---

## Dual-WAN Load Balance — PCC (Per-Connection Classifier)

Distribui conexões entre dois links simultaneamente (não é failover — é load balance real).
Usa `per-connection-classifier=src-address:2/0` e `2/1` para dividir tráfego pelo IP de origem.

```routeros
# Interface lists para WAN
/interface list
add name=wan comment=wan
/interface list member
add l

Sponsored

Ads related to Mikrotik Routeros and adjacent AI workflows.