Runbook: Troubleshoot IPsec
1 · Prerequisites
Confirm every item is in place before any state change.
- IPsec concept — IKE, ESP, transport vs tunnel mode, the IPsec suite
- IKEv2 — Internet Key Exchange v2, RFC 7296, MOBIKE, EAP authentication
- ESP proposals — ciphers, integrity, DH/PFS groups, configuration
- NAT-T — NAT traversal for IPsec, UDP 4500 encapsulation
- IPsec troubleshooting — IKE debug, ESP debug, MTU, PFS mismatch
- VPN MTU — tunnel MTU, MSS clamping, fragmentation
- VPN logs — IKE logs, charon, WireGuard, the diagnostic capture
- Evidence first — collect before changing, write down symptoms, no action without data
2 · Pre-checks
Read-only diagnostic commands. If any of these don't match expected output, stop and investigate further.
- · The report is converted into a symptom before any command is run. "The tunnel is down" is what was said; "the IKE SA is absent", "the child SA is up and carries bytes in one direction only" and "large packets do not cross" are three unrelated faults and this is the sentence that decides which one you are working on.
- · Whether this tunnel EVER worked is established, and if it did, when it stopped. A tunnel that has never come up is a parameter-agreement problem between two ends. A tunnel that stopped is a change, an expiry or a path problem, and the parameters are almost certainly innocent.
- · The scope is established with
show vpn ipsec sa: is this one peer, or every peer on the router? Every peer at once points at this router or its WAN path, not at the far end, and it changes who you call first. - · Whether the peer is route-based or policy-based is established BEFORE any selector or routing check, because those checks differ.
show vpn ipsec sanames it: a child SA calledPEER-vtiis route-based,PEER-tunnel-Nis policy-based. - · Out-of-band console access is confirmed by using it, BEFORE any remediation. Several of the fixes below touch the WAN firewall or the IPsec daemon, and on a router reached over the tunnel that is the access path.
- · Nobody has run
restart ipsecor reset the peer yet. If someone has, say so in the ticket: the SA state for the failure is gone, andshow log ipseconly covers the current boot, so a reboot has taken the log with it. - · The far end has an owner who is reachable now. At least half of the evidence in an IPsec fault lives on the other router — in particular the responder-side log lines that name WHICH parameter mismatched — and about a third of the causes can only be fixed there.
- · The change record for both ends is checked for the last 72 hours — proposals, certificates, firewall, WAN addressing, upstream provider work.
show system commitgives this router half of that in one command. IPsec has no self-healing path around a parameter change. - · The agreed parameter sheet for this peer is to hand: IKE version, encryption, hash, PRF, DH group, lifetime; ESP encryption, hash, PFS, mode, lifetime; the identities each end presents. Without it you cannot tell a mismatch from a working configuration.
3 · Procedure
Execute each step in order. Verify the expected output of a step before moving to the next.
- 1Capture the failing state before touching anything:
show vpn ike sa,show vpn ipsec sa,show vpn ipsec sa detail,show vpn ipsec connections,show vpn ipsec status. Save the output to the ticket. This is the evidence that any later reset destroys. - 2Read those two outputs together and place the fault in one of three worlds. WORLD A: no IKE SA. WORLD B: IKE SA established, no child SA. WORLD C: both SAs present. The three share no further diagnostic steps, so do not run WORLD C commands against a WORLD A fault.
- 3Read the daemon log for the reason before theorising:
show log ipsec. A negotiation failure is logged with its cause, and one notify name there beats an hour of comparing configurations by eye. Ask the far end for the same window — the responder log names the mismatched value; the initiator log only carries the notify. - 4If the log is not saying enough, raise the level deliberately and temporarily:
set vpn ipsec log level 2, optionally narrowed withset vpn ipsec log subsystem ikeorchd, commit, reproduce, then put it back. - 5WORLD A — separate path from parameters with a capture, cheapest first:
monitor traffic interface eth0 filter "udp port 500 or udp port 4500 or proto esp". Nothing in either direction, outbound only, or traffic both ways are three different faults with three different owners. - 6WORLD A — if the path is proven open, the fault is a parameter or an identity. Compare the IKE proposal, PRF, DH group and IKE version against the agreed sheet on BOTH ends, then the PSK identities. A correct secret filed under an identity the peer does not present fails as AUTHENTICATION_FAILED, exactly like a wrong secret.
- 7WORLD B — IKE agreed and ESP did not. Check the ESP proposal and PFS group against the sheet, then check that the firewall permits what the peers actually switched to: IP protocol 50, or UDP 4500 if NAT was detected.
show vpn ike sareports NAT-T detection in its own column, so read it rather than assuming. - 8WORLD B — read the far end log for TS_UNACCEPTABLE as well as NO_PROPOSAL_CHOSEN. On a policy-based peer, mismatched prefixes fail the child SA while leaving the IKE SA up, and only the responder log names the offending selectors.
- 9WORLD C — read the counters in the Bytes In/Out column of
show vpn ipsec satwice, a minute apart. Bytes out advancing with bytes in frozen is not a working tunnel; it is your side encrypting into a far end that is not answering, and it is a far-end or path fault, not a local one. - 10WORLD C — if bytes move both ways and traffic still fails, walk the remaining causes in the order that suits the peer type. Route-based: routing first (
show ip routefor the remote prefix, pointing at the VTI), then firewall on the VTI, then MTU. Policy-based: traffic selectors inshow vpn ipsec sa detail, then firewall, then MTU. - 11WORLD C — test MTU explicitly rather than inferring it:
ping FAR size 1372 do-not-fragment count 3andping FAR size 100 do-not-fragment count 3. Small succeeds and large fails is the ESP overhead signature, and it is routinely reported as an application fault. - 12If the daemon and the kernel disagree — the SA reads as established and nothing is encrypted — check the kernel view with
show vpn ipsec stateandshow vpn ipsec policy, or collect everything at once withshow vpn debug. A daemon SA with no matching kernel state is a different fault from a negotiation failure. - 13Correlate the shape of the failure with the clock before proposing a cause. A tunnel that drops at a fixed interval is a rekey, lifetime or PFS fault. A tunnel that stopped on one specific date and stays down is an expiry — a certificate or a credential. Neither is diagnosed by watching it fail again.
- 14Only now decide on remediation, and prefer the narrowest action that addresses the evidence. Where a bounce is genuinely needed,
reset vpn ipsec site-to-site peer PEERtouches one peer;restart ipsectouches all of them. Record what you are about to change, the expected effect, and how you will know if it did not work. - 15Apply any configuration fix with
commit-confirm 10rather than a bare commit, verify against the same commands you captured in step 1, thenconfirmandsave. - 16Write the diagnosis as a layer, not as an outcome: "IKE never negotiated — firewall on the far end dropped UDP 4500 after their change window" is usable next time; "the tunnel was flapping, reset it, fine now" guarantees a repeat.
4 · Verification
Confirm the procedure actually fixed the problem.
- ✓
show vpn ike sashows the IKE SA established, and the NEGOTIATED values in its Encrypt, Hash and D-H Group columns are read from the output and compared against the agreed parameter sheet rather than assumed. A tunnel can come up on a weaker shared proposal than either end intended. - ✓
show vpn ipsec sashows a child SA whose Bytes In/Out counters advance in BOTH directions across two consecutive readings a minute apart. A single reading proves the SA exists; two readings prove it carries traffic. - ✓For a policy-based peer,
show vpn ipsec sa detailtraffic selectors cover the prefixes the application actually uses, not just the pair that was tested. For a route-based peer the selectors read 0.0.0.0/0 by design and prove nothing — check the routing table instead. - ✓The remote prefix is in the routing table via the VTI or the expected next hop —
show ip route— and that is the route the traffic will take. - ✓A do-not-fragment ping at the tunnel MTU crosses, and not only a default-size ping. Small-packet success with large-packet failure is the defect this check exists to catch.
- ✓One real application flow is tested from a host behind one side to a host behind the other. Router-to-router across the tunnel proves the SA; only host-to-host proves the routing, the firewall and the MSS clamp together.
- ✓
show log ipsecis clean of repeating negotiation errors for a period longer than the shortest configured lifetime, so a rekey has actually occurred under observation rather than being assumed to work. - ✓The OTHER tunnels on this router are re-checked with
show vpn ipsec saand are still established, and any temporary logging level or firewall rule opened during diagnosis has been removed. - ✓The diagnosis in the ticket names a layer — path, IKE proposal, authentication, ESP proposal, selectors, routing, MTU — and the evidence that established it.
5 · Rollback
If verification fails, undo the procedure in reverse order.
- ↶Diagnosis is read-only up to the point of remediation, so until a
committhere is nothing to roll back. Everything below concerns undoing the fix or the emergency action. - ↶A configuration fix still inside its
commit-confirmwindow that made things worse: do nothing and let the timer expire. The router reverts on its own, which matters here because a bad IPsec commit can disturb peers you were not working on. - ↶A committed and confirmed fix:
loadthe pre-change configuration file andcommit, or delete the specific nodes you added. Restoring the whole IPsec subtree in one step is safer than unpicking it by hand when several nodes were touched. - ↶Do NOT use
rollback Nas the undo on this router. The VyOS documentation states rollback applies the revision and triggers a system reboot; on a box terminating other tunnels that is an outage for all of them rather than a revert of one — and the reboot also ends the boot thatshow log ipseccan reach. - ↶Raised logging is a change that must be reverted:
delete vpn ipsec log leveland anylog subsystemvalues you added, thencommit. Level 2 is detailed debugging control flow for every negotiation on the box, which on a router with many peers is a lot of journal for a fault that has already been found. - ↶Any firewall rule opened to "test whether the firewall is the problem" is temporary by definition. Narrow it to the peer address and the specific protocol, or remove it, before the ticket is closed — a WAN rule opened at 02:00 outlives everyone who remembers why.
- ↶If the peer was reset or the daemon restarted to restore service, that is a service restoration, not a diagnosis. Record that the evidence was lost, and keep the ticket open until the cause is found or the next occurrence is instrumented.
6 · Escalation
When the runbook isn't enough, contact:
- · Escalate to the far-end owner as soon as local evidence points outward, and send the evidence with it: a capture showing IKE leaving and nothing returning, or a child SA with bytes out and zero bytes in. Both are complete proof of a far-end or path condition, and further local reconfiguration only adds variables to a problem that is not yours to fix.
- · Ask the far-end owner specifically for their responder-side log for the failing window. On a proposal or selector mismatch the initiator only receives a notify; the responder logs the received and the configured values side by side, which is the line that ends the argument.
- · Escalate to network engineering or the upstream provider when the capture shows outbound IKE and no response and the far end confirms they are answering. That is a path condition between two networks and neither router owner can fix it.
- · Escalate to the security owner before deploying any proposal containing 3DES, DES, MD5, SHA-1 or DH group 1, 2 or 5 to make a tunnel come up, even when the far end demands it. Interoperating with weak crypto is a documented exception with an owner, not an operator decision taken during an incident.
- · Escalate to the security owner immediately if a pre-shared key has been sent through a ticket, chat or email during the investigation. It is a symmetric credential; copies of it do not expire, and rotation is a coordinated two-ended change that has to be scheduled.
- · Escalate to the certificate or PKI owner if the failure correlates with an expiry date. Renewal is their change, it needs its own window, and the tunnel will not come back until it happens.
- · Hold rather than proceed when the two ends have no agreed parameter sheet and the tunnel has never worked. Trial-and-error negotiation across two change windows produces a tunnel whose actual crypto nobody chose. Record the hold with an owner and an end time, and hand the window back.
“The tunnel is down” is a report, not a symptom. It is what a user says when a file share stopped responding, what a monitoring system says when a probe across the tunnel timed out, and what the far end says when their side shows no SA. Those three describe faults that have no diagnostic steps in common.
The first job of this runbook is to convert the report into a symptom, and
one pair of commands does most of that work. show vpn ike sa and
show vpn ipsec sa, read together, place every IPsec fault in one of three
worlds:
| What the two commands show | World | What is actually broken |
|---|---|---|
| No IKE SA | A | The path, or the IKE proposal, or authentication |
| IKE SA established, no child SA | B | The ESP proposal, the selectors, or the firewall for ESP / UDP 4500 |
| IKE SA and child SA both present | C | Routing, selectors, the far end, or MTU |
Everything after this is world-specific. The most expensive mistake in an IPsec incident is running world C’s commands against a world A fault — which is what happens when the operator starts from “let me check the routing” instead of from the SA table.
When this runbook applies
- A site-to-site IPsec tunnel that was carrying traffic and has stopped.
- A tunnel that comes up and drops on a repeating cycle.
- A tunnel that reads as established while traffic across it fails.
- A newly built tunnel that will not come up, after the build runbook has been followed and both ends have an agreed parameter sheet.
When it does not
- Building a tunnel from nothing. Use the configure runbook. It orders the work so the path is proven before any parameter is typed, which is a build sequence rather than a diagnosis.
- Remote-access (road-warrior) IPsec. Different subtree, an address pool,
an authentication backend and a client population. The three-world split
still applies; the specific commands live under
show vpn ipsec remote-accessinstead. - WireGuard. Same job, entirely different diagnostics — no negotiation, no SA table, one handshake timestamp. Part XLI-06 covers it.
Establish the peer type before you establish anything else
Route-based and policy-based peers fail differently and are diagnosed
differently, and the difference is invisible in the symptom. show vpn ipsec sa names it in the Connection column without you having to read the
configuration:
| Connection name | Peer type | What decides which traffic is encrypted |
|---|---|---|
PEER-vti | Route-based (VTI) | The routing table. Selectors are 0.0.0.0/0 by design |
PEER-tunnel-0, PEER-tunnel-1 | Policy-based | The configured tunnel N local/remote prefix pairs |
Getting this backwards costs an hour reliably. On a VTI, “the traffic selectors are 0.0.0.0/0 and my prefixes are not in them” is the correct state, not the fault — a VTI carries whatever is routed into it, so it negotiates the wildcard and lets the routing table decide. On a policy-based peer, the selectors are the whole mechanism and a mismatch is the fault.
Blast radius, and the three things not to do first
Every command up to the remediation step is read-only. The danger in an IPsec incident is not the diagnosis; it is the three actions that feel like the obvious first move.
restart ipsec. It restarts the strongSwan process, so it drops every
tunnel on the router rather than the one you are working on, and it destroys
the SA evidence for the failure you were sent to explain. Sometimes it also
appears to fix things, which is worse: the tunnel comes back, the ticket
closes, and the cause is still there waiting for the next rekey. VyOS gives
you narrower instruments and they are covered below — reach for those first.
Retyping the parameters. If the tunnel worked yesterday, the parameters are not the cause. Re-entering them proves nothing, and a commit made under pressure to a shared IPsec configuration can disturb peers that were fine.
Turning off the firewall to see if the firewall is the problem. On a WAN interface this is a security incident that has been scheduled to happen later. Test with a narrow rule for the peer address and the specific protocol, and remove it afterwards.
Step 1: capture the failing state before you touch it
show vpn ike sa
show vpn ipsec sa
show vpn ipsec sa detail
show vpn ipsec connections
show vpn ipsec statusSave all of it to the ticket now. Diagnosis is a comparison between the failing state and the working one, and the failing state exists only while the fault does.
Read show vpn ipsec sa for scope as well as for state. If every peer on
the router is down, the fault is on this router or its WAN path, and calling
one far-end owner is the wrong first move. If one peer is down and the rest
are established, the router’s IPsec daemon, its WAN interface and its global
IPsec options are all working, which eliminates a large part of the search.
show vpn ike sa is also where NAT traversal is answered rather than
assumed: it carries a NAT-T column per SA, and show vpn ike sa nat-traversal
narrows the view to the SAs where detection fired. On a router with many
peers, show vpn ike sa peer PEER scopes the whole first look to the one
you were paged about — but run the unscoped version at least once first,
because the scope question above is answered by what the OTHER peers are
doing.
Step 2: the log holds the reason
The strongSwan daemon logs the negotiation. It records which message it sent, which it received, and why one failed — the reason for a failure is in the log even when the SA table only says the SA is absent.
show log ipsecThree shapes of log line carry most of the diagnosis:
- A negotiation that gets no answer. Repeated
IKE_SA_INITrequests and eventually the daemon giving up. Your side is talking and nothing is coming back: a path or far-end condition, not a parameter one. - A negotiation that is answered and rejected. The peer replies and the
exchange fails with a named notify —
NO_PROPOSAL_CHOSEN,AUTHENTICATION_FAILED,TS_UNACCEPTABLE. The notify tells you which agreement broke; it does not tell you which value disagreed. - A tunnel that establishes and then tears down on a cycle. Read the
interval between
establishedand the teardown and compare it with the configured lifetimes.
If the default level is not saying enough, raise it deliberately:
configure
set vpn ipsec log level '2'
set vpn ipsec log subsystem 'ike'
set vpn ipsec log subsystem 'chd'
commitVyOS accepts a global level of 0, 1 or 2 and nothing higher: 0 is basic
auditing (SA up, SA down), 1 is generic control flow with errors, and 2 is
detailed debugging control flow. log subsystem narrows the noise to the
parts of the daemon you care about — ike for the IKE SA, chd for the
child SA, cfg for configuration handling, knl for the kernel interface,
net for IKE network communication, esp for the ESP payload path.
Raising the level on a router with many peers raises it for all of them. Return it as part of closing the ticket.
Step 3 (world A): no IKE SA — path or parameters
Two minutes of capture tells you which half of world A you are in, and invalidates the other half completely.
monitor traffic interface eth0 filter 'udp port 500 or udp port 4500 or proto esp'| What the capture shows | Where the fault is | Next action |
|---|---|---|
| Nothing at all, either direction | Local: the daemon is not initiating, or the local firewall drops it outbound | Check the peer’s connection-type, then the local firewall |
| Outbound only | Far end or the path between | Escalate outward with the capture; stop changing local parameters |
| Traffic both ways, no SA | Parameters or identities | Continue below |
The first row deserves one extra check before you blame the firewall. A peer
configured connection-type none is loaded and waits to be initiated from
the far side — it will never send anything on its own, and a capture showing
silence is the expected behaviour rather than a fault. connection-type initiate on both ends is the opposite error and produces duplicate child
SAs and apparent flapping.
Outbound-only is the case operators most often talk themselves out of. The temptation is to keep adjusting local proposals because that is what is within reach, but a peer that never answers has not seen your proposals at all. The capture is complete evidence of a far-end condition and it is worth more to the other operator than any further local change is worth to you.
When traffic flows both ways and no SA forms, the disagreement is in the negotiation itself. Compare against the agreed sheet, on both ends:
show configuration commands | match "vpn ipsec ike-group"
show configuration commands | match "vpn ipsec esp-group"
show configuration commands | match "vpn ipsec site-to-site peer"There is no show vpn ipsec ike-group operational command — the groups are
configuration, so you read them from the configuration. The lines above do
that from operational mode; from configuration mode, show vpn ipsec ike-group displays the same subtree.
The IKE version, encryption, hash, PRF and DH group must have at least one combination in common. When they do not, the negotiation fails on the proposal and the log says so; what your side’s log does not say is which parameter disagrees, which is why the sheet — and the responder’s log — matter more than the error message.
Step 4 (world B): IKE agreed, ESP did not
An established IKE SA with no child SA is a narrow and useful state. It means the path carried IKE, the peers found a common IKE proposal, and authentication succeeded. Everything before ESP is proven working, so stop looking at it.
Three causes account for nearly all of world B, and the log distinguishes them by notify name.
The ESP proposals do not have a common combination — NO_PROPOSAL_CHOSEN
arriving after the IKE SA is already up, logged alongside failed to establish CHILD_SA, keeping IKE_SA. IKE and ESP are negotiated separately
with separate proposal lists, so two ends can agree on one and disagree on
the other. Compare the ESP group against the sheet, including PFS: the DH
group used for PFS is part of the agreement, and a PFS mismatch fails the
child SA while leaving the IKE SA up. Note that pfs enable inherits the DH
group from the IKE group rather than naming one, so two configurations that
look different can agree and two that look the same can not.
The traffic selectors do not overlap — TS_UNACCEPTABLE, again with
failed to establish CHILD_SA, keeping IKE_SA. This is a policy-based
failure: the two ends configured tunnel N local/remote prefix pairs that do
not correspond. It does not occur on a route-based peer, because a VTI
negotiates 0.0.0.0/0 and there is nothing to disagree about. If you are
looking at a PEER-vti child SA, cross this cause off.
The firewall permits IKE but not what the peers switched to. This one produces no notify at all, because nothing arrives to generate one. ESP is IP protocol 50 and carries no ports, so a NAT device has nothing to build a translation on; both ends detect NAT during the IKE exchange and move to UDP 4500 encapsulation automatically. A rule set written for “IPsec” that permits UDP 500 only now drops everything that matters. The IKE SA stays up, because IKE was permitted; the data plane never forms.
show vpn ike sa nat-traversal
show firewall ipv4 input filter
show firewall statistics
# The three things IPsec needs on the WAN, from the peer address:
# UDP 500 IKE
# UDP 4500 IKE and ESP once NAT traversal is in use
# protocol 50 (ESP) where no NAT is in the pathRead the firewall counters rather than the intent. An accept rule sitting at zero packets while a default-action counter climbs means your traffic is being matched by something other than the rule you believe is in effect.
Where the capture shows ESP leaving and nothing arriving, and NAT was not
detected, the peer option force-udp-encapsulation forces ESP into UDP
datagrams anyway. It is the documented lever for a middlebox that drops plain
ESP without doing NAT, and it is a two-ended conversation because the far end
has to accept UDP 4500 for it.
Step 5 (world C): both SAs up and traffic still fails
World C has four causes, and they are cheap to separate in this order.
Read the counters in both directions. This is the check that catches the most and gets skipped the most.
show vpn ipsec sa
# wait 60 seconds, then again
show vpn ipsec saBytes out advancing with bytes in frozen is not a working tunnel. Your side
is encrypting and sending; nothing is coming back. The cause is on the far
end or in the path — their routing, their firewall, their selectors — and no
local change fixes it. A single reading cannot show this, because counters
that are non-zero from an earlier working period look healthy while frozen.
show vpn ipsec sa prints Packets In/Out beside Bytes In/Out; on a very
quiet tunnel the packet counters move first and are the more sensitive read.
Routing — and for a route-based peer this is where you start. The remote prefix must be in the table via the VTI, and it must be the route the traffic actually takes.
show interfaces vti vti0
show ip route 192.0.2.0/24
show vpn debugshow vpn debug earns its place here for one specific and recurring VTI
failure. strongSwan installs its auto-created routes in policy routing table
220, and on a route-based peer that is exactly what must not happen: the
tunnel’s 0.0.0.0/0 selectors would produce a default route via the VTI peer
address, which is why set vpn ipsec options disable-route-autoinstall is
mandatory for VTI deployments. A populated table 220 on a VTI router means
that option is missing, and the symptom it produces is traffic disappearing
into a tunnel it was never meant to enter.
Selectors and firewall. For a policy-based peer, show vpn ipsec sa detail shows the traffic selectors the child SA was negotiated with; traffic
outside them is not matched by the security policy and is forwarded in the
clear or dropped, not encrypted. For a route-based peer this check tells you
nothing, because the answer is always 0.0.0.0/0. Separately, and for both
types, a firewall applied to the tunnel interface can drop what the tunnel
successfully carried.
MTU. Test it explicitly; it is never obvious from the tunnel’s own state.
# 1372 payload + 20 bytes IP + 8 bytes ICMP = a 1400-byte packet,
# which is a typical VTI MTU once ESP overhead is allowed for.
ping 10.100.100.2 size 1372 do-not-fragment count 3
# Then the small case, so a failure above means "too big" and not "no path".
ping 10.100.100.2 size 100 do-not-fragment count 3Remediation instruments, narrowest first
When the diagnosis calls for a bounce rather than a configuration change, VyOS gives you five instruments and they are not interchangeable. Four of them are narrower than the one most operators reach for.
| Command | What it touches |
|---|---|
reset vpn ipsec site-to-site peer PEER vti | The VTI child SA of one peer |
reset vpn ipsec site-to-site peer PEER tunnel 0 | One policy-based child SA of one peer |
reset vpn ipsec site-to-site peer PEER | All child SAs of one peer |
reset vpn ipsec site-to-site all | Every site-to-site peer on the router |
restart ipsec | The strongSwan process, and therefore everything |
Work down that list, not up it. A stuck child SA on one peer is a
reset ... peer PEER problem; reaching for restart ipsec because it is the
command everyone remembers converts a single-tunnel incident into a
multi-tunnel one and deletes the SA evidence on the way through.
None of these is a diagnosis. Each one restores service by discarding state, which is a legitimate thing to do under pressure and a terrible thing to record as a root cause.
Let the clock narrow the cause
The shape of the failure over time is evidence, and it is often stronger than anything in the configuration.
| Timing | What it points at | What it rules out |
|---|---|---|
| Never worked since it was built | Parameter or identity disagreement | Anything that changed recently |
| Dropped once and stayed down | A change, a path event, or an expiry | Rekey and lifetime faults |
| Drops at a fixed repeating interval | Rekey: lifetime or PFS disagreement | The initial negotiation, which plainly worked |
| Drops once and never returns on its own | connection-type initiate with no DPD and no close-action | The path, if a manual reset brings it straight back |
| Stopped on one date and will not return | Certificate or credential expiry | The path, which was fine an hour earlier |
| Intermittent with no pattern | Path loss, or a flapping WAN under the tunnel | A configuration cause on either end |
A tunnel that dies on a cycle has already told you the answer: the initial negotiation succeeded, so the initial parameters agree, and what fails is the renegotiation. Compare the configured lifetimes and PFS settings on both ends, and note that the two ends do not have to agree on lifetime for the tunnel to come up — only for it to keep coming back.
The fourth row is the one this course keeps returning to. VyOS documents that
connection-type initiate brings the connection up immediately and does not
restart it after a disconnection, and that it should therefore be used only
alongside dead-peer-detection or close-action. A tunnel that goes down once
after a brief path event and then stays down, while a manual reset restores
it instantly, is that configuration gap and not a mystery.
What each step costs if you get it wrong
| Action | Cost when it is the wrong move |
|---|---|
restart ipsec first | Every tunnel on the router drops; the evidence for this one is gone |
| Skipping the capture in world A | An evening aligning proposals that were always compatible, against a firewall rule nobody looked at |
| Not asking the far end for their log | Comparing configurations by eye for hours to derive a value the responder logged once |
| Checking selectors on a route-based peer | An hour spent “fixing” 0.0.0.0/0, which is the correct value for a VTI |
| Retyping parameters on a tunnel that worked yesterday | No new information, plus a commit to shared IPsec configuration during an incident |
| Reading one counter instead of two readings in both directions | A one-way tunnel signed off as working |
| Lowering the MTU without measuring | Hides a routing or firewall fault behind a throughput penalty that nobody later understands |
| Opening the WAN firewall to test | A security exposure that outlives everyone who remembers why it was opened |
Leaving log level 2 in place | Detailed negotiation logging for every peer on the box, indefinitely |
| Closing the ticket on “reset it, fine now” | The same page next week, with no more evidence than this time |
Escalation, and holding as a first-class option
Escalate outward the moment local evidence points outward, and send the evidence rather than a conclusion. A capture showing IKE leaving and nothing returning, or a child SA with bytes in one direction only, is complete proof of a far-end condition. Continuing to change local parameters against it adds variables to somebody else’s problem and makes their diagnosis harder.
When you escalate to the far end, ask for one specific thing: their
show log ipsec output for the same minute. If they are the responder, that
log contains the comparison your side never saw.
Holding is a legitimate outcome and needs to be recorded like any other. Hold when the two ends have no agreed parameter sheet and the tunnel has never worked: trial-and-error across a window produces, at best, a tunnel whose crypto nobody chose. Hold when the fix requires a certificate renewal or a proposal change that the security owner has not approved. In both cases write down the owner, what is being waited on, and when the hold expires, then hand the window back rather than spending it.
References
- VyOS documentation — troubleshooting site-to-site IPsec (op-mode output shapes, charon log lines for each failure mode)
- VyOS documentation — IPsec site-to-site VPN (peer tree, connection types, full op-mode and reset command list)
- VyOS documentation — IPsec general information (ike-group, esp-group, log level and subsystem, IKEv2 retransmission)
- VyOS documentation — VTI interfaces, and why route autoinstall must be disabled
- strongSwan documentation — constraints and error notifications
- RFC 7296 — Internet Key Exchange Protocol Version 2 (IKEv2)
- RFC 3948 — UDP Encapsulation of IPsec ESP Packets (NAT-T)