add_route
Adds a route to the MikroTik routing table by specifying a destination CIDR and gateway, with optional routing table, distance, and gateway checks.
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)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"dst_address": "<dst_address>",
"gateway": "<gateway>"
},
"name": "add_route"
}
}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 |