get_ipsec_installed_sa
Lists installed IPsec child/phase 2 security associations and their flags to distinguish SAs carrying traffic from those only installed.
Instructions
Lists the installed IPsec security associations (child/phase 2 SAs).
The Flags legend is the point of this view. On RouterOS 7 it reads:
S - SEEN-TRAFFIC the SA has carried packets
H - HW-AEAD the cipher is running in hardware
E - ESPS is the only field that separates an SA carrying traffic from one that
is merely installed. A remote end reporting the connection as up, or its
own byte counters growing, does not contradict a missing S: those count
what the far side sent, not what arrived.
Two things this does NOT tell you, both easy to get wrong:
A missing
Scan mean idle, not broken. An SA nothing has used looks exactly like one that is failing, and RouterOS withholdsaddtimeandexpires-inuntil traffic appears, which makes it look half installed. Put traffic over the selector before concluding anything.Per-SA counters do not map onto policies once a peer has several child SAs. Traffic picks among them, so one SA can carry the outbound side of two policies while another sits frozen at the counter it had minutes after install. Pairing SAs by hand — by install time, by address, by lifetime — invents a structure that is not there. Watch which counters move under traffic you control instead.
Notes:
Address filters are substring matches on the SA endpoints, which are the
tunnel endpoints (public addresses), not the encapsulated subnets.
Behind NAT-T the endpoints carry the port (198.51.100.2:4500), which
is why this is not an exact match: filtering on the bare address would
find nothing there and report no SAs while some exist.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_ipsec_installed_sa"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device | No | ||
| dst_address_filter | No | ||
| src_address_filter | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |