FortiGate IPsec: Setup, Configuration, and Troubleshooting
Learn how FortiGate IPsec VPNs work, how to configure a tunnel, and how to resolve common connection issues.
FortiGate IPsec is Fortinet’s implementation of IPsec VPN technology on FortiGate firewalls. It encrypts traffic across untrusted networks, typically connecting two office networks or giving remote users secure access to company resources. A working VPN requires compatible settings on both peers, correct routing and firewall policies, and a way to verify that traffic is passing through the tunnel.
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 common FortiGate IPsec VPN types
| VPN type | Typical use | Endpoints | Main setup choice | Best fit |
|---|---|---|---|---|
| Site-to-site | Connect office networks | FortiGate appliances or compatible peers | Peer details and routed subnets | Branch connectivity |
| Remote access | Connect individual users | FortiGate and user devices | Client authentication and access policy | Mobile or home users |
| Route-based | Carry traffic through tunnel interfaces | IPsec peers | Tunnel interfaces and routing | Flexible routing and policies |
| Policy-based | Match traffic with tunnel policies | IPsec peers | Selectors and firewall policies | Simpler, narrowly scoped tunnels |
| IKEv1 | Negotiate IPsec security associations | Compatible peers | IKE version and proposal compatibility | Legacy interoperability |
| IKEv2 | Negotiate IPsec security associations | Compatible peers | IKE version and proposal compatibility | Supported modern deployments |
Compiled November 2026; check the provider's site for current details.
What FortiGate IPsec Does
IPsec protects IP traffic by authenticating the VPN peers and encrypting data between them. On FortiGate, an IPsec VPN can be configured as a site-to-site tunnel between gateways or as a remote-access VPN for individual users.
An IPsec tunnel has two negotiation stages:
- Phase 1 (IKE): Establishes a secure control channel between the peers. It covers authentication, encryption, integrity, and key-exchange settings.
- Phase 2 (IPsec): Defines which traffic is protected and establishes the security associations used to encrypt that traffic.
Both sides need compatible proposals, authentication methods, and network definitions. They do not always need identical labels or interface names, but their effective settings must match.
Common FortiGate IPsec VPN Types
| VPN type | Typical use | Main configuration considerations |
|---|---|---|
| Site-to-site | Connecting two offices or networks | Peer addresses, local and remote subnets, routing, and firewall policies |
| Remote access | Connecting users to a company network | User authentication, client configuration, address assignment, and access controls |
| Route-based | Sending selected traffic through a virtual tunnel interface | Tunnel interface, routes, policies, and possibly dynamic routing |
| Policy-based | Defining protected traffic through policies or selectors | Traffic selectors and policy matching |
Route-based VPNs are commonly used on FortiGate because they work naturally with routing and firewall policies. The right design depends on the FortiOS version, the peer device, and the network requirements. FortiGate L2TP: Setup, Security, and Alternatives
How to Configure a Basic Site-to-Site Tunnel
Before configuring either firewall, record the public IP addresses, internal subnets, and required security settings for both sites. Confirm that each site uses non-overlapping LAN address ranges. Overlapping subnets can make routing ambiguous and may require redesign or address translation.
1. Configure Phase 1
In the FortiGate VPN settings, create a new IPsec tunnel and specify the remote gateway. Set the authentication method, such as a pre-shared key or certificates, and select compatible IKE and cryptographic options.
Review these Phase 1 settings on both peers:
- IKE version
- Authentication method and credentials
- Encryption and integrity algorithms
- Diffie-Hellman group
- Key lifetime
- NAT traversal, if a peer is behind NAT
Use current, secure algorithms supported by both devices. Avoid outdated options where possible, and follow your organization’s security policy. FortiGate VPN Client: Setup, Configuration, and Troubleshooting
2. Configure Phase 2
Define the local and remote traffic selectors, often called local and remote subnets. Choose compatible encryption, integrity, and key lifetime settings.
For example, if one office uses 10.10.0.0/16 and the other uses 10.20.0.0/16, each side must describe those networks from its own perspective: the local subnet on one peer is the remote subnet on the other.
3. Add Routing and Firewall Policies
A negotiated tunnel does not automatically mean that users can communicate through it. Add routes directing the remote network to the IPsec tunnel, unless the design uses an appropriate dynamic-routing setup. Then create firewall policies permitting only the required traffic between the relevant interfaces and networks.
Check that: Best Free VPN Where You Can Choose Location: What to Look For
- The policy uses the correct incoming and outgoing interfaces.
- Source and destination address objects match the intended subnets.
- Services are limited to what the business requires.
- NAT is disabled for ordinary site-to-site traffic unless address translation is intentionally part of the design.
4. Test Traffic
Generate traffic between permitted devices on each side. Check the tunnel status and confirm that traffic counters increase. Testing only from a FortiGate itself may not follow the same path as traffic from a LAN client, so test with real endpoints as well.
Compare common FortiGate IPsec troubleshooting checks
| Symptom | Check first | Useful evidence | Likely area | Next step |
|---|---|---|---|---|
| Tunnel will not establish | Peer address and reachability | IKE status and logs | Connectivity or peer settings | Confirm addressing and peer configuration |
| Phase 1 fails | IKE version and proposals | IKE negotiation logs | Authentication or proposal mismatch | Compare settings on both peers |
| Phase 2 fails | Selectors and IPsec proposals | Phase 2 status and logs | Subnet or proposal mismatch | Align selectors and encryption settings |
| Tunnel is up, traffic fails | Routes and firewall policies | Routing table and policy hits | Routing or access control | Verify routes and permit policies |
| One subnet cannot communicate | Local and remote selectors | Tunnel counters and traffic logs | Selectors or subnet routes | Check both peers’ subnet definitions |
| Intermittent tunnel | Link stability and rekey settings | Event logs and tunnel status | Network changes or rekeying | Review logs and peer stability |
Compiled November 2026; check the provider's site for current details.
Troubleshooting FortiGate IPsec
Start by identifying whether the issue is with negotiation, routing, policy, or the endpoint. A tunnel shown as “up” confirms that security associations exist, but it does not prove that the intended traffic can pass. Free VPN Choose Location: How to Pick a Server Safely
Tunnel Will Not Establish
Check the peer’s public IP address and confirm that the required connectivity is available. If a device is behind NAT, verify NAT traversal and any upstream firewall rules. Compare Phase 1 settings, then Phase 2 proposals and traffic selectors. A mismatch in one parameter can prevent negotiation.
For a controlled diagnostic session, FortiGate’s CLI can help show IKE activity. Common commands include:
diagnose vpn ike gateway list
diagnose vpn tunnel list
Debug commands can produce substantial output. Use them carefully, filter where supported, and disable debugging after collecting the needed information. Syntax and available options can vary by FortiOS release.
Tunnel Is Up, but Traffic Fails
Check the routes on both FortiGates and verify that firewall policies allow the traffic in each required direction. Confirm that the endpoints use the expected default gateways and that host firewalls are not blocking the connection. OVPN Explained: What It Is and How to Use It
Also inspect the Phase 2 selectors. If they exclude the source and destination addresses being tested, the traffic may not match the tunnel. Review policy hit counts and VPN byte counters to see whether packets are reaching the expected rules and tunnel.
Intermittent or Unstable Connections
Look for changing public IP addresses, unstable internet connectivity, mismatched lifetimes, or dead-peer detection settings. Check logs for rekey events and negotiation failures. If the tunnel crosses a device with short UDP timeouts, NAT traversal behavior may also be relevant.
Keep FortiOS and peer software maintained according to your organization’s change process. Before changing production VPN settings, document the current configuration and plan a maintenance window if the change could interrupt service.
Security and Maintenance Best Practices
A reliable FortiGate IPsec deployment should be both secure and easy to operate. Use strong, unique pre-shared keys when certificates are not practical, and store credentials securely. Restrict VPN access to necessary networks and services rather than allowing broad access by default. Proton Free VPN: What You Get and Whether It’s Worth Using
Other useful practices include:
- Prefer modern IKE and cryptographic settings supported by both peers.
- Use certificates where they fit the organization’s identity-management requirements.
- Keep an accurate record of subnets, peer addresses, and proposals.
- Monitor VPN logs and alert on unexpected tunnel failures.
- Review access regularly, especially for remote users and third-party connections.
- Back up configurations before making changes.
Choose FortiGate IPsec security and maintenance practices
| Practice | Main benefit | What to verify | Operational impact | Priority |
|---|---|---|---|---|
| Use strong proposals | Better cryptographic protection | Peer compatibility | May require coordinated changes | High |
| Prefer IKEv2 when supported | Modern negotiation option | Both peers support IKEv2 | May affect legacy peers | High |
| Use strong authentication | Reduces unauthorized access risk | Keys or certificates are managed securely | Requires careful credential handling | High |
| Restrict firewall policies | Limits permitted tunnel traffic | Only required sources and services are allowed | More precise policy management | High |
| Keep FortiOS maintained | Access to fixes and security updates | Supported release and upgrade notes | Requires change planning | High |
| Monitor tunnel status and logs | Faster fault detection | Events, negotiation failures, and traffic | Ongoing operational review | Medium |
| Document peer and subnet settings | Easier troubleshooting and recovery | Addresses, selectors, and policy dependencies | Requires documentation upkeep | Medium |
Compiled November 2026; check the provider's site for current details.
Recommendation
For most new site-to-site deployments, use a route-based FortiGate IPsec tunnel with clearly defined routes and least-privilege firewall policies. Confirm that Phase 1 and Phase 2 settings match at both ends, then test with real network traffic and verify logs and counters. When a tunnel fails, troubleshoot negotiation first, followed by selectors, routing, firewall policies, and endpoint behavior. NordVPN Not Working in China? Causes and Fixes to Try

