A Virtual Private Network (VPN) is a secure way to connect devices or networks over an encrypted channel. FortiGate supports multiple VPN types for different use cases.
SSL VPNs provide encrypted access to a network using the SSL/TLS protocol. They are particularly useful for remote users who need secure access to internal resources.
Web Mode:
Tunnel Mode:
Define User Groups:
Create or import user accounts (local or external authentication via LDAP, RADIUS).
Example (CLI):
config user group
edit "SSLVPN_Users"
set member "user1" "user2"
end
Configure SSL VPN Portal:
Define the listening port and address ranges for SSL VPN connections.
Example (CLI):
config vpn ssl settings
set servercert "Fortinet_CA"
set port 443
set tunnel-ip-pools "SSLVPN_Tunnel_Range"
end
Define the portal:
config vpn ssl web portal
edit "Full_Access"
set tunnel-mode enable
set web-mode enable
set ip-pools "SSLVPN_Tunnel_Range"
end
Set Up Policies to Allow Resource Access:
Create policies to allow SSL VPN traffic to reach internal resources.
Example (CLI):
config firewall policy
edit 10
set srcintf "ssl.root"
set dstintf "lan"
set srcaddr "all"
set dstaddr "Server_Subnet"
set action accept
set schedule "always"
set service "ALL"
end
IPsec VPNs are widely used for site-to-site connections or remote access scenarios. They provide secure tunnels for encrypted communication.
Purpose:
Configuration Steps:
Phase 1 Configuration:
Establishes the secure tunnel and authenticates peers.
Example (CLI):
config vpn ipsec phase1-interface
edit "SiteA_to_SiteB"
set interface "wan1"
set ike-version 2
set authmethod psk
set psksecret "PreSharedKey"
set proposal aes256-sha256
set peerip 192.0.2.2
end
Phase 2 Configuration:
Handles encryption for the data traveling through the tunnel.
Example:
config vpn ipsec phase2-interface
edit "P2_SiteA_to_SiteB"
set phase1name "SiteA_to_SiteB"
set proposal aes256-sha256
set src-subnet 192.168.1.0/24
set dst-subnet 192.168.2.0/24
end
Create a policy to allow traffic through the VPN:
config firewall policy
edit 20
set srcintf "SiteA_to_SiteB"
set dstintf "lan"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ALL"
end
Purpose:
Configuration Steps:
Example CLI:
config vpn ipsec phase1-interface
edit "Remote_IPsec"
set interface "wan1"
set mode aggressive
set authmethod psk
set psksecret "RemoteKey"
set proposal aes256-sha256
end
Dead Peer Detection (DPD):
Monitors the health of the tunnel and terminates it if the peer is unreachable.
CLI Example:
set dpd enable
set dpd-retryinterval 10
Redundant Tunnels for Failover:
SiteA_to_SiteB_Primary.SiteA_to_SiteB_Backup.By following these workflows, you can set up VPNs on FortiGate to securely connect users and networks.
When configuring SSL VPN access in FortiGate, it's important to understand how traffic flows from VPN clients to internal resources.
The source interface in the firewall policy for SSL VPN traffic is ssl.root, not a physical interface like port1 or wan1.
ssl.root.wan1 or internal, which breaks VPN functionality.config firewall policy
edit 10
set srcintf "ssl.root"
set dstintf "lan"
set srcaddr "all"
set dstaddr "Internal_Network"
set action accept
set service "ALL"
set schedule "always"
end
When configuring Remote Access IPsec VPNs, FortiGate must dynamically assign IP addresses to remote users who connect using FortiClient.
This is done using mode-cfg (mode configuration), which allows FortiGate to function like a DHCP server for VPN clients.
config vpn ipsec phase1-interface
edit "RemoteAccess"
set mode-cfg enable
set ipv4-start-ip 10.10.10.10
set ipv4-end-ip 10.10.10.20
set ipv4-netmask 255.255.255.0
end
10.10.10.10 to 10.10.10.20).RemoteUsers address object used in firewall policies.You may be asked which feature is responsible for assigning IPs to remote IPsec VPN users—answer: mode-cfg.
IKE (Internet Key Exchange) is the protocol used in IPsec VPN Phase 1 negotiations. FortiGate supports both IKEv1 and IKEv2.
set ike-version 2
You may see a multiple-choice question comparing features of IKEv1 vs. IKEv2 or asking which is recommended for modern VPN deployments (Answer: IKEv2).
VPN configuration errors can occur at many levels. Here are common issues and where to look for answers.
Possible causes:
Command to list active tunnels:
diagnose vpn tunnel list
Command to view Phase 1 negotiation:
diagnose debug application ike -1
diagnose debug enable
Other helpful commands:
get vpn ipsec tunnel summarydiagnose vpn ike gateway listdiagnose debug reset (to clear debug output)sniffer command (diagnose sniffer packet any 'port 500 or 4500' 4) to monitor IKE traffic.| Topic | Description | Exam Relevance |
|---|---|---|
| SSL VPN Source Interface | Must use ssl.root as source in firewall policy |
High – common trap |
| Mode-cfg for IPsec Remote VPN | Assigns IP addresses to remote users | Medium – CLI focused |
| IKEv1 vs. IKEv2 | Understanding trade-offs in negotiation protocols | Medium – comparison |
| VPN Troubleshooting | Commands and scenarios to resolve tunnel failures | High – practical skill |
What does a Phase1 negotiation failure typically indicate in an IPsec VPN?
A mismatch in Phase1 parameters between the two VPN peers.
Phase1 establishes the secure channel used to negotiate Phase2 parameters. If the two devices have mismatched settings such as authentication method, encryption algorithm, pre-shared key, or DH group, Phase1 negotiation will fail. Administrators should verify that both VPN peers have identical Phase1 configurations.
Demand Score: 90
Exam Relevance Score: 93
What is the main purpose of Phase2 in an IPsec VPN?
To define the encryption parameters used to protect actual data traffic.
Once Phase1 establishes a secure control channel, Phase2 negotiates the IPsec security associations used to encrypt user traffic. Phase2 parameters include encryption algorithms, integrity checks, and the networks protected by the VPN tunnel.
Demand Score: 85
Exam Relevance Score: 92
Why might an SSL VPN user fail to log in even though the credentials are correct?
The user may not belong to the authorized user group configured in the SSL VPN settings.
FortiGate SSL VPN access is controlled through user groups assigned in the SSL VPN configuration and firewall policies. Even if authentication succeeds, the connection will be denied if the user is not part of the allowed group. Troubleshooting typically involves verifying group membership and authentication server configuration.
Demand Score: 82
Exam Relevance Score: 89
Why might an IPsec tunnel show as up but traffic does not pass through it?
The Phase2 selectors may not match the actual source and destination networks.
Even if Phase1 and Phase2 negotiations succeed, traffic will not pass if the configured local and remote subnets do not match the networks generating the traffic. Administrators should confirm that the Phase2 selectors correctly represent the internal networks on both sides of the VPN.
Demand Score: 79
Exam Relevance Score: 91
Why is a firewall policy required for VPN traffic?
Because VPN tunnels only encrypt traffic but do not automatically allow it through the firewall.
After traffic enters a VPN tunnel and reaches the firewall, it must still match a firewall policy to be permitted. Administrators often forget to create a policy allowing traffic between the VPN interface and internal networks, which results in blocked traffic even though the VPN tunnel is established.
Demand Score: 77
Exam Relevance Score: 90