A thick, friendly layer over the MikroTik RouterOS API
routerosmikrotiknetworkrouterapi
Every published version of this deck has been yanked. Nothing here will be chosen by a new install. A lockfile that already pins one of these versions keeps working.
| Version | Status | Kind | Pin | Requires | Engines | Capabilities |
|---|---|---|---|---|---|---|
| 0.1.0 | yanked | git | 46ad273e73be | - | jennifer >=0.25.0 | net |
LGPL-3.0-only
0.1.0Times a client asked this registry where to find this deck. Not downloads: the registry only stores metadata, and the code is fetched from its repository directly, so we never see an install and cannot count one. Repeated builds inflate these numbers; installs from an existing lockfile do not appear at all. Counted in UTC.
A thick layer over the MikroTik RouterOS API for the Jennifer language.
The bundled mikrotik module speaks the raw binary API: command paths, =key=value words, reply sentences. routeros wraps that in plain verbs and typed structs so you can configure interfaces, bridges, and the firewall without knowing RouterOS internals. All input is validated before it touches the wire; every failure is an Error{kind: "routeros"} (or kind: "mikrotik" from the transport) with a human-readable message.
import "@jennifer/routeros/" as mt;
def c as mt.Client init mt.connect("192.168.88.1", "admin", "secret");
# see what gets sent (credentials are redacted); MT_VERBOSE=1 does the same
$c = mt.setVerbose($c, true);
# bridges
mt.addBridge($c, "brlan");
mt.addBridgePort($c, "brlan", "ether2");
# interfaces
mt.disableInterface($c, "ether5");
mt.commentInterface($c, "ether1", "uplink");
# firewall
mt.allowService($c, "tcp", 22, "ssh management");
mt.blockAddress($c, "203.0.113.7", "known scanner");
def r as mt.FirewallRule init mt.firewallRule(mt.CHAIN_FORWARD, mt.ACTION_DROP);
$r = mt.withProtocol($r, "tcp");
$r = mt.withDstPort($r, "445");
$r = mt.withComment($r, "no smb forwarding");
mt.addFirewallRule($c, $r);
mt.disconnect($c);See examples/ for one runnable example per topic, e.g. MT_HOST=... MT_USER=... MT_PASSWORD=... jennifer run examples/firewall.j.
examples/<topic>.j)MikroTik and RouterOS are trademarks of SIA Mikrotīkls. This project is an independent, community-written client library; it is not affiliated with, endorsed, or supported by SIA Mikrotīkls. It configures live network equipment - review what a call does before pointing it at production hardware. Use at your own risk; no warranty of any kind.
Licensed under the GNU LGPL v3.0 only - see LICENSE. Copyright © 2026 mplx <[email protected]>. Every source file carries an SPDX-License-Identifier: LGPL-3.0-only header.