add_route
Adds a static route to the MikroTik routing table using destination CIDR and gateway, with optional routing table, distance, and gateway check settings.
Instructions
Adds a route to the routing table.
Notes: dst_address: CIDR e.g. "0.0.0.0/0", "192.168.1.0/24" routing_table: name of a table from /routing table, e.g. "via_ISP2"; defaults to "main". RouterOS 6 called this the routing mark. check_gateway: "ping" or "arp" distance: 1-255 (lower = higher priority)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | No | ||
| device | No | ||
| comment | No | ||
| gateway | Yes | ||
| disabled | No | ||
| distance | No | ||
| pref_src | No | ||
| dst_address | Yes | ||
| target_scope | No | ||
| check_gateway | No | ||
| routing_table | No | ||
| vrf_interface | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |