FortiGate IPsec Debug: A Practical Troubleshooting Guide

Learn how to capture FortiGate IPsec debug output, diagnose common tunnel failures, and stop debugging safely.
FortiGate IPsec debug helps you find why an IPsec VPN is not establishing or passing traffic. Start by checking the tunnel and routing, then capture filtered IKE output while reproducing the issue. The most useful commands are diagnose vpn ike log-filter, diagnose debug application ike -1, and diagnose debug enable. Because debug output can be extensive, filter it to the affected peer and turn it off as soon as you finish.
Editor's pick: NordVPN — fast, secure VPN — Strong encryption, a no-logs policy and apps for every device. 30-day money-back guarantee. Get NordVPN →
Choose the right FortiGate IPsec troubleshooting view
| View | Best for | What it shows | Main limitation |
|---|---|---|---|
| IKE debug | Negotiation failures | IKE exchange messages | Can produce noisy output |
| VPN event logs | Reviewing past events | Recorded tunnel status and errors | Less detail than debug |
| Tunnel status | Quick health check | Phase 1 and Phase 2 state | Does not explain the cause |
| Routing table | Reachability checks | Selected routes | Does not confirm IPsec policy matches |
| Firewall policy review | Traffic blocked by policy | Policy and security settings | Does not diagnose IKE negotiation |
| Packet capture | Following packet flow | Packets at selected interfaces | Requires careful filtering |
| Peer-side logs | Comparing both ends | Remote negotiation view | Access may not be available |
Compiled November 2026; check the provider's site for current details.
Before you enable IPsec debug
First identify whether the problem is negotiation or traffic flow. A tunnel can appear down because IKE negotiation failed, but it can also be up while routing, firewall policy, or Phase 2 selectors prevent traffic from passing.
Check the tunnel status:
get vpn ipsec tunnel summary
diagnose vpn tunnel list
Then verify the configuration on both peers, including:
- The remote gateway address and interface
- IKE version and Phase 1 authentication settings
- Phase 2 proposals, encryption, authentication, and selectors
- Pre-shared key or certificate configuration
- Routes and firewall policies for the protected networks
Record the affected tunnel name and remote peer IP. You will use those details to narrow the debug output. V2Ray Free: What It Is, How to Choose a Safe Option, and What to Expect
Capture a filtered IKE debug
FortiGate versions may differ in available log-filter options. In the CLI, check the command help with diagnose vpn ike log-filter? if a particular filter is not accepted. A common workflow is:
diagnose vpn ike log-filter clear
diagnose vpn ike log-filter rem-addr4 <peer-ip>
diagnose debug reset
diagnose debug application ike -1
diagnose debug enable
Now reproduce the failure: initiate the tunnel, generate matching traffic, or wait for the peer to reconnect. Read the CLI output and look for the first negotiation error, rather than focusing only on the final failure message.
When you have enough output, stop the debug:
diagnose debug disable
diagnose debug reset
diagnose vpn ike log-filter clear
The -1 setting requests detailed IKE application output. It can produce a large volume of messages, so keep the session short and use a peer filter whenever possible. Avoid leaving debug enabled unattended on a busy firewall. Cisco Secure Client AnyConnect VPN: What It Does and How to Use It
Match symptoms to likely IPsec failure areas
| Symptom | Likely area | What to check | Useful evidence |
|---|---|---|---|
| Phase 1 does not establish | IKE settings | Peer address, proposals, authentication | IKE debug messages |
| Phase 1 establishes, Phase 2 fails | IPsec settings | Selectors, proposals, PFS settings | Phase 2 negotiation messages |
| Tunnel is up, traffic fails | Forwarding path | Routes, policies, NAT, selectors | Counters and packet capture |
| One direction works | Return path | Remote routes and policies | Captures at both ends |
| No IKE messages appear | Connectivity or filter | Peer reachability and debug filters | Interface capture |
| Negotiation repeatedly restarts | Peer or link stability | Rekey behavior and connectivity | Timestamps in logs |
| Only some subnets work | Selectors or routing | Local and remote subnet definitions | Route and policy comparison |
Compiled November 2026; check the provider's site for current details.
Read the messages in context
IKE output describes a sequence of exchanges. The exact wording varies by FortiOS release, but the point where negotiation stops often indicates what to check next.
| Debug symptom | Likely area to check |
|---|---|
| No exchange appears | Peer address, routing, interface, NAT, or whether negotiation was triggered |
| Peer does not respond | Reachability, upstream filtering, UDP 500 or 4500, or the remote gateway |
| Authentication or ID failure | Pre-shared key, certificate, local ID, or peer ID |
| No matching proposal | IKE or IPsec encryption, authentication, DH group, or lifetime settings |
| Phase 1 succeeds, Phase 2 fails | Phase 2 proposal, selectors, proxy IDs, or PFS settings |
| Tunnel is up but traffic fails | Routes, policies, NAT, selectors, or return-path routing |
Treat these as diagnostic clues, not definitive conclusions. For example, “no proposal chosen” usually points to incompatible settings, but confirm the full exchange and compare both peers’ configurations before changing anything. FortiClient VPN: How It Works, How to Set It Up, and When to Use It
Diagnose Phase 1 and Phase 2 failures
Phase 1: IKE negotiation
Phase 1 establishes the IKE security association between the peers. If the peers cannot agree on the IKE version, proposal, authentication method, or identities, the tunnel will not reach Phase 2.
Compare settings on both ends:
- IKE version
- Encryption and authentication algorithms
- Diffie-Hellman group
- Authentication credentials or certificates
- Local and peer IDs, when configured
- NAT traversal and gateway addresses
A timeout without a clear rejection can point to a connectivity issue rather than a proposal mismatch. Confirm that the peer is reachable and that relevant traffic can pass between the gateways.
Phase 2: IPsec negotiation
Phase 2 negotiates the security associations that protect traffic between the private networks. If Phase 1 is established but Phase 2 fails, compare the Phase 2 proposals and traffic selectors on both peers. Nord VPN China Doesn't Work? Causes, Fixes, and What to Try
Check that the protected subnet ranges match as expected. A selector mismatch can prevent the desired traffic from entering the tunnel even when the IKE connection itself is healthy. Also verify Perfect Forward Secrecy settings and lifetimes where those options are configured.
If the tunnel is up but traffic does not pass
IKE debug is primarily useful for negotiation problems. If the tunnel is established, check the forwarding path as well:
- Confirm the FortiGate has a route to the destination network through the IPsec interface or tunnel.
- Check that firewall policies permit traffic in both required directions.
- Verify whether NAT is enabled or excluded for VPN traffic as intended.
- Confirm the traffic matches the Phase 2 selectors.
- Check counters and security associations with
diagnose vpn tunnel list. - Verify the remote peer has a return route and matching policies.
Use a packet capture when you need to see whether packets reach the FortiGate, leave through the tunnel, or return from the peer. This helps separate an IKE negotiation issue from a routing or policy issue.
Use a safe, focused IKE debug workflow Thunder VPN PC: How to Use It and Which Alternatives to Consider
| Step | Action | Decision point | Caution |
|---|---|---|---|
| 1 | Identify the affected tunnel and peer | Confirm the correct connection | Avoid broad debugging |
| 2 | Check tunnel status and logs | Determine the failing phase | Record the initial state |
| 3 | Filter debug to the relevant peer | Keep output focused | Verify the filter |
| 4 | Enable IKE debug briefly | Reproduce the issue | Output may contain sensitive details |
| 5 | Read messages in sequence | Find the first failure | Do not rely on one line alone |
| 6 | Disable debug after capture | Stop unnecessary output | Confirm debugging is off |
| 7 | Compare settings at both peers | Identify mismatched parameters | Preserve working configuration |
| 8 | Retest and document results | Confirm the change helped | Share sanitized logs only |
Compiled November 2026; check the provider's site for current details.
Safe debugging and next steps
Capture only what you need, and avoid sharing unreviewed debug output publicly. It can contain network details, peer identifiers, and configuration clues. Redact sensitive information before sending logs to a colleague or support team.
For a clear troubleshooting record, note the FortiOS version, tunnel name, peer address, time of the test, and the first relevant error message. This makes it easier to compare the FortiGate’s behavior with the remote gateway’s logs.
Recommendation
Use FortiGate IPsec debug only after checking the tunnel status and basic configuration. Filter IKE output to the affected peer, reproduce the problem once, and stop debugging immediately afterward. If negotiation succeeds but traffic still fails, shift attention to selectors, routes, firewall policies, NAT, and packet flow. NordVPN Not Logging In? Causes and Fixes to Try
