add_wireguard_peer
Add a WireGuard peer to a MikroTik interface using its public key and allowed IP addresses, with optional endpoint and persistent keepalive settings.
Instructions
Adds a WireGuard peer (with public key and allowed addresses) to an interface on the MikroTik device.
Notes: allowed_address: CIDR, comma-separated for multiple e.g. "10.0.0.2/32" or "10.0.0.0/24,192.168.0.0/24" endpoint_address: remote host IP or hostname e.g. "203.0.113.1" persistent_keepalive: seconds as string e.g. "25"
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": {
"interface": "<interface>",
"public_key": "<public_key>",
"allowed_address": "<allowed_address>"
},
"name": "add_wireguard_peer"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device | No | ||
| comment | No | ||
| disabled | No | ||
| interface | Yes | ||
| public_key | Yes | ||
| endpoint_port | No | ||
| preshared_key | No | ||
| allowed_address | Yes | ||
| endpoint_address | No | ||
| persistent_keepalive | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |