VPN推荐评测
VPN

FortiGate IPsec: Setup, Configuration, and Troubleshooting

宋知遥··8 min
FortiGate IPsec: Setup, Configuration, and Troubleshooting

Learn how FortiGate IPsec VPNs work, how to configure them, and how to resolve common connection problems.

FortiGate IPsec is a VPN capability on FortiGate firewalls that encrypts traffic between locations or between remote users and a network. To establish a working tunnel, configure matching Phase 1 and Phase 2 settings, then provide the routes and firewall policies needed to carry traffic. A tunnel that shows as “up” is not necessarily passing traffic. Routing and policy configuration matter just as much as encryption settings.

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 →

Compare FortiGate IPsec deployment options

OptionTypical usePeer typePhase 1 setupPhase 2 setupMain consideration
Site-to-siteConnect office networksAnother VPN gatewayMatch IKE settingsMatch traffic selectorsBoth peers need compatible settings
Remote accessConnect individual usersUser device or VPN clientConfigure authenticationAllow intended network trafficPlan user access and client setup
Route-based tunnelFlexible network routingVPN gatewayEstablish IPsec security associationDefine tunnel interface trafficRequires appropriate routes and policies
Policy-based tunnelNarrow, defined trafficVPN gatewayEstablish IPsec security associationSpecify protected trafficSelectors must match between peers
IKEv1Legacy interoperabilityCompatible VPN peerUse matching IKE version and proposalsAgree on Phase 2 proposalsPrefer IKEv2 where supported
IKEv2Modern VPN deploymentsCompatible VPN peerUse matching IKE version and proposalsAgree on Phase 2 proposalsBoth peers must support IKEv2
Pre-shared keyShared-secret authenticationConfigured peerUse the same secret on both peersConfigure matching proposalsProtect and manage the secret
Certificate authenticationCertificate-based authenticationConfigured peerValidate certificates and identityConfigure matching proposalsRequires certificate management

Compiled November 2026; check the provider's site for current details.

What FortiGate IPsec does

IPsec protects IP traffic by authenticating the other endpoint and encrypting data in transit. FortiGate uses Internet Key Exchange (IKE) to negotiate security settings and establish IPsec Security Associations (SAs).

Common deployment types include:

  • Site-to-site VPN: Connects two or more networks, such as a branch office and headquarters.
  • Remote-access VPN: Lets individual users connect to a private network, typically through a compatible VPN client.
  • Hub-and-spoke VPN: Connects multiple branch sites through a central FortiGate hub.

Many deployments use IKEv2, though the correct choice depends on the peer device, client, FortiOS version, and security requirements. The settings at both ends must be compatible.

FortiGate IPsec: Setup, Configuration, and Troubleshooting: Checklist

Phase 1 and Phase 2 explained

FortiGate IPsec configuration is commonly divided into two negotiation stages. FortiGate L2TP: Setup, Limitations, and Alternatives

Phase 1 establishes an authenticated IKE relationship between peers. Typical settings include:

  • Remote gateway address or peer identification
  • IKE version
  • Authentication method and credentials
  • Encryption and integrity algorithms
  • Diffie-Hellman group
  • Lifetime and, where used, NAT traversal settings

Phase 2 establishes the IPsec SAs that protect the actual data. It defines the traffic selectors, often called local and remote subnets, and settings such as encryption, integrity, perfect forward secrecy, and lifetime.

Setting Phase 1 Phase 2
Main purpose Authenticate peers and establish IKE Protect selected network traffic
Common parameters IKE version, credentials, algorithms Subnets, IPsec algorithms, PFS
Typical mismatch symptom IKE negotiation fails IKE may connect, but data SAs do not establish or traffic does not pass

For a site-to-site tunnel, the local and remote network definitions must be reversed appropriately on the two FortiGate units. For example, if one side’s local network is 10.10.0.0/16 and its remote network is 10.20.0.0/16, the peer generally uses the reverse selection.

Basic site-to-site setup

The exact screens and options can vary by FortiOS release and whether you use the setup wizard or manual configuration. Before starting, record the public peer addresses, protected subnets, authentication details, and agreed algorithms for both ends. FortiGate VPN Client: Setup, Features, and Troubleshooting

A typical setup follows these steps:

  1. Create the IPsec tunnel. Choose a site-to-site configuration and specify the remote gateway. Select the IKE version and authentication method supported by both peers.
  2. Configure Phase 1. Set compatible proposals, Diffie-Hellman groups, lifetimes, and peer identification where required. Use a strong pre-shared key or certificate-based authentication.
  3. Configure Phase 2. Define the local and remote traffic selectors and matching IPsec proposals. Confirm that the peer uses the corresponding reversed subnet definitions.
  4. Add routing. Route the remote protected subnet through the IPsec interface or use the routing approach appropriate to the design. Dynamic routing may be suitable for larger networks.
  5. Create firewall policies. Allow traffic from the local network to the VPN interface and, if required, from the VPN interface back to the local network. Apply appropriate security profiles and logging.
  6. Test both directions. Generate traffic between hosts in the protected networks, then verify the tunnel, routes, policies, and traffic counters.

Avoid overly broad policies where narrower subnet and service rules will work. Also confirm that local hosts use the FortiGate as their gateway, or have another route that directs protected traffic to it.

Remote-access considerations

Remote-access IPsec has different requirements from a site-to-site tunnel. The FortiGate must authenticate users or devices, assign or provide access to client address ranges, and allow the intended destinations through firewall policies.

Plan for: Free VPN Where You Can Choose Location: What to Try and How to Choose

  • A compatible client and IKE configuration
  • User or certificate authentication
  • Address assignment and DNS settings
  • Routes to internal networks
  • Policies from the VPN interface or zone to permitted destinations
  • Multi-factor authentication where supported and appropriate

Check for overlap between the client address pool and internal networks. Overlapping ranges can cause confusing routing behavior even when the VPN successfully connects.

FortiGate IPsec: Setup, Configuration, and Troubleshooting: Key points

Phase 1 and Phase 2 configuration comparison

SettingPhasePurposeMust match peer?Common checkIf mismatched
IKE versionPhase 1Negotiates the VPN connectionYesCompare IKEv1 or IKEv2Phase 1 may not establish
Peer identityPhase 1Identifies the remote gatewayYesCheck configured IDsAuthentication may fail
Authentication methodPhase 1Verifies the peerYesCompare key or certificate usePeer authentication may fail
Encryption proposalBothProtects negotiated trafficYesCompare supported algorithmsNegotiation may fail
Integrity proposalBothChecks data integrityYesCompare integrity algorithmsNegotiation may fail
Diffie-Hellman groupPhase 1Creates shared key materialYesCompare configured groupsPhase 1 may fail
LifetimeBothSets security association durationCompatible valuesCompare timers on both peersRekeying may be disrupted
Traffic selectorsPhase 2Defines protected networksYesCompare local and remote subnetsPhase 2 may fail
PFS settingPhase 2Adds key exchange during rekeyingYesCompare PFS and group settingsPhase 2 may fail

Compiled November 2026; check the provider's site for current details.

Troubleshooting a FortiGate IPsec tunnel

Start by identifying where the failure occurs. Is the peer unreachable, is IKE negotiation failing, is Phase 2 missing, or is the tunnel established but traffic blocked? Free VPN Choose Location: How to Pick and Connect Safely

Useful checks in the FortiGate CLI include:

get vpn ipsec tunnel summary
diagnose vpn ike gateway list
diagnose vpn tunnel list

For live IKE negotiation details, an administrator may use:

diagnose debug reset
diagnose debug application ike -1
diagnose debug enable

Reproduce the connection attempt, review the output, then stop debugging:

diagnose debug disable
diagnose debug reset

Debug output can contain sensitive information. Use it carefully and share it only with trusted administrators. OVPN: What It Is, How It Works, and How to Use an.ovpn File

Common causes include:

  • Phase 1 fails: Check peer reachability, IKE version, authentication, peer ID, and Phase 1 proposals.
  • Phase 1 works but Phase 2 fails: Compare traffic selectors, Phase 2 proposals, PFS settings, and lifetimes.
  • Tunnel is up but traffic fails: Check routes, firewall policies, NAT behavior, host gateways, and return paths.
  • Only some traffic works: Review selectors, policy services, overlapping subnets, and asymmetric routing.
  • Tunnel drops intermittently: Check peer connectivity, rekey settings, dead-peer detection, and logs on both devices.

Make configuration changes in a controlled way. Compare both peers’ settings side by side, change one relevant parameter at a time, and confirm that both sides use compatible proposals. FortiOS commands and available options vary by version, so consult the documentation for the installed release before applying CLI changes.

Security and maintenance

Use modern, mutually supported cryptographic algorithms and avoid legacy options unless compatibility requires them. Keep FortiOS and VPN clients updated, protect credentials, and limit VPN access to the networks and services users need.

Document peer addresses, subnets, authentication methods, and negotiated proposals. Review logs and tunnel status after upgrades or network changes, and test failover and recovery if the VPN supports redundancy. Proton Free VPN: What You Get and Whether It’s Worth Using

Troubleshooting checks by symptom

SymptomFirst checkFortiGate areaPeer-side checkLikely issueNext step
Phase 1 is downReachability to peerVPN status and logsPublic IP and IKE settingsConnectivity or proposal mismatchVerify routing and Phase 1 settings
Phase 1 authentication failsPeer ID and credentialsVPN configuration and logsID, key, or certificateAuthentication mismatchConfirm identity and authentication method
Phase 1 is up, Phase 2 is downTraffic selectorsPhase 2 settings and logsLocal and remote subnetsSelector or proposal mismatchCompare Phase 2 settings
Tunnel is up, traffic failsPolicies and routesFirewall policy and routingReturn route and selectorsTraffic not permitted or routedCheck both directions
Only one direction worksReturn pathRoutes and policiesRemote routes and policiesAsymmetric routing or missing ruleConfirm bidirectional reachability
Tunnel drops periodicallyTimers and link stabilityVPN events and interface statusPeer timers and connectivityRekey or connectivity problemCompare lifetimes and inspect logs
Remote users cannot connectClient settings and authenticationRemote-access configurationClient version and credentialsClient or authentication mismatchVerify supported settings and access rules

Compiled November 2026; check the provider's site for current details.

Recommendation

For a reliable FortiGate IPsec deployment, first agree on Phase 1 and Phase 2 settings with the peer administrator, then configure routes and narrowly scoped firewall policies. Validate traffic in both directions and use FortiGate diagnostics to troubleshoot each negotiation stage separately.

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