MikroTik Config Formatter

Beautify and organize MikroTik RouterOS scripts, exports, and .rsc configuration files online. Format firewall, NAT, queue, route, and address list sections into clean readable configurations while detecting duplicate rules, disabled entries, and potentially dangerous firewall or service settings for RouterOS 6 and 7.
Loading...
Import Script
Formatting Options
Analysis Summary
Sections0
Duplicate Rules0
Dangerous Configurations0
Disabled Rules0
Beautified Output
RouterOS 7Sections: 0Warnings: 0Disabled: 0

Overview

The MikroTik Config Formatter cleans up RouterOS export scripts, terminal copy-paste, and .rsc files into readable output organized by configuration section. It detects duplicate rules, disabled entries, and a set of dangerous firewall or service settings across RouterOS 6 and 7 configurations. Use it before reviewing or auditing a router's exported configuration.

Common Use Cases

How to Use

1
Select RouterOS 6 or RouterOS 7, then either import a .rsc or .txt file or paste the raw script into the Raw Script text area.
2
Choose the formatting options: multi-line formatting, preserving comments, duplicate detection, dangerous configuration detection, and disabled rule detection.
3
Click Beautify Script to process the input.
4
Read the Analysis Summary for the section, duplicate, dangerous, and disabled counts, and review the warning list if dangerous settings were found.
5
Copy the beautified output or download it as beautified.rsc.

Example Scenario

Auditing an exported firewall configuration

Paste an export that leaves telnet disabled=no, repeats the same address list entry twice, and marks several rules disabled=yes. With detection enabled, the tool reports one dangerous configuration labeled Telnet service enabled, flags the duplicate rule, and lists the disabled entries, while reorganizing the output under section banners for /ip firewall filter and /ip firewall address-list.

Technical Notes

Lines that start with a slash, such as /ip firewall filter, begin a new section. Every following line is grouped under that section and the output adds a banner showing the section name.

With multi-line formatting on, lines starting with add or set are split so each parameter sits on its own line joined by backslash continuations, which is how RouterOS expects a multi-line command.

Duplicate detection compares each line after collapsing all whitespace, so two rules that differ only in spacing are still treated as identical.

The danger scan looks for five patterns: Telnet, FTP, or API services left enabled (disabled=no), any use of 0.0.0.0/0, and an accept-all chain=input firewall rule.

A rule is reported as disabled when its text contains disabled=yes.

Header comments starting with # are kept only when the preserve comments switch is on.

Common Mistakes

Frequently Asked Questions

The import field accepts .rsc and .txt files. You can also paste a script directly from the RouterOS terminal into the Raw Script box.

Each line is normalized by collapsing all whitespace and then compared against the lines already seen. Any identical normalized line after the first is reported as a duplicate.

The tool flags Telnet, FTP, or API services left enabled, anything exposing the router via 0.0.0.0/0, and an accept-all chain=input rule, which are common weak points in exported configs.

Disabled rules are only counted when the detect disabled rules switch is on, but they are always kept in the formatted output so you can see the complete configuration.

Both versions are accepted. The selected version is only recorded on the output badge; the parsing and formatting logic is the same for both.

Related Topics