VPN推荐评测
VPN

FortiGate IPsec Debug: A Practical Troubleshooting Guide

宋知遥··7 min
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.

NordVPN — fast, secure VPN

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

ViewBest forWhat it showsMain limitation
IKE debugNegotiation failuresIKE exchange messagesCan produce noisy output
VPN event logsReviewing past eventsRecorded tunnel status and errorsLess detail than debug
Tunnel statusQuick health checkPhase 1 and Phase 2 stateDoes not explain the cause
Routing tableReachability checksSelected routesDoes not confirm IPsec policy matches
Firewall policy reviewTraffic blocked by policyPolicy and security settingsDoes not diagnose IKE negotiation
Packet captureFollowing packet flowPackets at selected interfacesRequires careful filtering
Peer-side logsComparing both endsRemote negotiation viewAccess 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

FortiGate IPsec Debug: A Practical Troubleshooting Guide: Checklist

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

SymptomLikely areaWhat to checkUseful evidence
Phase 1 does not establishIKE settingsPeer address, proposals, authenticationIKE debug messages
Phase 1 establishes, Phase 2 failsIPsec settingsSelectors, proposals, PFS settingsPhase 2 negotiation messages
Tunnel is up, traffic failsForwarding pathRoutes, policies, NAT, selectorsCounters and packet capture
One direction worksReturn pathRemote routes and policiesCaptures at both ends
No IKE messages appearConnectivity or filterPeer reachability and debug filtersInterface capture
Negotiation repeatedly restartsPeer or link stabilityRekey behavior and connectivityTimestamps in logs
Only some subnets workSelectors or routingLocal and remote subnet definitionsRoute 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.

FortiGate IPsec Debug: A Practical Troubleshooting Guide: Key points

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

StepActionDecision pointCaution
1Identify the affected tunnel and peerConfirm the correct connectionAvoid broad debugging
2Check tunnel status and logsDetermine the failing phaseRecord the initial state
3Filter debug to the relevant peerKeep output focusedVerify the filter
4Enable IKE debug brieflyReproduce the issueOutput may contain sensitive details
5Read messages in sequenceFind the first failureDo not rely on one line alone
6Disable debug after captureStop unnecessary outputConfirm debugging is off
7Compare settings at both peersIdentify mismatched parametersPreserve working configuration
8Retest and document resultsConfirm the change helpedShare 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

© 2026 信远网络评测 · Xinyuan Net Review Ltd.