routeros-firewall

Solid

RouterOS firewall filter, NAT, mangle, and address-list configuration. Use when: writing firewall rules in RouterOS, configuring NAT, setting up address-lists or interface-lists, writing idempotent firewall scripts, configuring DNS redirect or port forwarding, or when the user mentions /ip/firewall, chain=forward, chain=input, connection-state, address-list, interface-list, or layer7-protocol on MikroTik.

API & Backend 40 stars 9 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
54
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# RouterOS Firewall ## Rule Ordering — Sequential, Not Priority-Based Rules are evaluated **top-to-bottom** — first match wins. This is the biggest source of iptables confusion. - `place-before=0` inserts at the top; default `add` appends at the bottom - An `action=accept` rule must appear BEFORE any `action=drop` for the same traffic - **Non-terminal actions do NOT stop evaluation:** `action=add-src-to-address-list`, `action=add-dst-to-address-list`, `action=log`, and any rule with `passthrough=yes` continue to the next rule. A `drop` rule below an `add-src-to-address-list` will still fire. ```routeros # WRONG — drop fires before accept can match /ip/firewall/filter/add chain=input action=drop /ip/firewall/filter/add chain=input src-address=10.0.0.1 action=accept # CORRECT — accept first, drop catches the rest /ip/firewall/filter/add chain=input src-address=10.0.0.1 action=accept place-before=0 /ip/firewall/filter/add chain=input action=drop ``` ## Address-Lists as Dynamic Selectors LLMs rarely suggest this pattern — they write one rule per IP address instead. Address-lists scale to hundreds of IPs with a single firewall rule. ```routeros # Build the list (static or dynamic with auto-expiry) /ip/firewall/address-list/add list=trusted-mgmt address=192.168.1.0/24 /ip/firewall/address-list/add list=trusted-mgmt address=10.0.0.5 timeout=1h # One rule handles all list members /ip/firewall/filter/add chain=input src-address-list=trusted-mgmt action=accept \ comment="mya...

Details

Author
tikoci
Repository
tikoci/routeros-skills
Created
4 months ago
Last Updated
1 weeks ago
Language
Shell
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

API & Backend Solid

routeros-fundamentals

RouterOS v7 domain knowledge for AI agents. Use when: working with MikroTik RouterOS, writing RouterOS CLI/script commands, calling RouterOS REST API, debugging why a Linux command fails on RouterOS, or when the user mentions MikroTik, RouterOS, CHR, or /ip /system /interface paths. Scope: RouterOS 7.x (long-term and newer) only — v6 is NOT covered and accuracy for v6 problems will be low.

40 Updated 1 weeks ago
tikoci
AI & Automation Solid

unifi-firewall

Use when working on UniFi firewall rules, zones, or network segmentation: "my firewall rules are empty", "rest/firewallrule returns nothing", "isolate my IoT devices", "block cameras from the internet", "create a firewall zone", "VLAN isolation", "zone-based firewall", "my IoT devices lost DNS after I segmented them", or auditing what a zone actually permits. Covers the zone-based firewall model, where policies live, the block-by-default trap on new zones, and lockout safety. Assumes unifi-connect. Not for assigning devices to VLANs or switch ports (unifi-clients), Wi-Fi and SSID-to-network mapping (unifi-wifi).

30 Updated 2 days ago
t3chnaztea
Code & Development Solid

routeros-scripting

RouterOS scripting language and CLI configuration idioms for .rsc files and interactive commands. Use when: writing or reviewing RouterOS scripts, scheduler/netwatch/on-event snippets, idempotent CLI config, :local/:global/:foreach/:do syntax, [find] selectors, print as-value handling, script permissions, or when the user mentions .rsc, RouterOS script, scripting tips, or CLI config automation.

40 Updated 1 weeks ago
tikoci