Manage Firewall Rule
manage_firewall_ruleAdd, remove, enable, or disable firewall rules on MikroTik routers. Uses comment for idempotency and supports dry-run mode to validate changes without applying.
Instructions
Add, remove, disable, or enable a firewall rule on a MikroTik router. Uses comment as idempotency key for deduplication and identification. Supports dry-run mode.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| routerId | Yes | Target router identifier from the router registry | |
| table | No | Firewall table to manage: filter or nat | filter |
| action | Yes | Action to perform: add, remove, disable, or enable a firewall rule | |
| chain | Yes | Firewall chain (e.g. forward, input, output, srcnat, dstnat) | |
| ruleAction | Yes | RouterOS rule action (e.g. accept, drop, reject, masquerade) | |
| srcAddress | No | Source address or network | |
| dstAddress | No | Destination address or network | |
| protocol | No | Protocol to match | |
| srcPort | No | Source port or range | |
| dstPort | No | Destination port or range | |
| inInterface | No | Incoming interface | |
| outInterface | No | Outgoing interface | |
| comment | No | Comment to identify the rule (used as idempotency key) | |
| disabled | No | Whether the rule should be disabled | |
| placeBefore | No | Place the new rule before this rule ID | |
| dryRun | No | If true, validate and return planned changes without applying | |
| confirmationToken | No | Token from a prior APPROVAL_REQUIRED response. Re-submit the identical call with this token to confirm the destructive action. |