Why this matters — the visa interview analogy
Picture a visa interview at the Indian consulate in Frankfurt. Phase 1 is the identity check — the officer verifies your passport, fingerprints, and that you are who you claim. Phase 1 is not about the visa; it is about trust. Phase 2 is the actual visa stamp negotiation — which countries, how many entries, how long. Phase 2 only happens after Phase 1 succeeds. Fail the identity check, and the visa conversation never starts.
FortiGate's IPsec works exactly the same. IKE Phase 1 authenticates the two peers and builds a secure control channel. IKE Phase 2 then negotiates the actual data SAs that will encrypt your user packets via ESP. Phase 2 cannot start until Phase 1 finishes. Get this single mental model right and the next 10 minutes of the interview belong to you.
Suhail (L2 network engineer, 4 years in) gets a project: stand up a site-to-site IPsec tunnel from the Pune branch FortiGate-60F (10.20.10.1 internal, public 203.0.113.45) to the Bangalore HQ FortiGate-100F (10.10.0.1 internal, public 203.0.113.10). Subnets 10.20.10.0/24 ↔ 10.10.0.0/16. He also has to roll out FortiClient SSL VPN to 200 work-from-home users in two weeks.
Suhail's first instinct: pick IKEv1 because "everyone knows it". Wrong call. IKEv2 has been the default for new deployments since FortiOS 7.0 — fewer messages, built-in NAT-T, MOBIKE for roaming, and better DPD. He flips the proposal to IKEv2 before he writes a single config line. We will see why at the end.
Two phases every interviewer will test
PSK auth in Phase 1 is fastest to set up — two FortiGates, one shared secret, done. Certificate auth scales further: each peer uses an X.509 cert signed by your internal CA. The trade-off is operational: PSK = one secret to rotate per tunnel; cert = a PKI to run. DH group 14 is the floor everyone should hit in 2026; 19 or 20 (ECDH P-256/P-384) for fresh deployments. PFS on Phase 2 is non-negotiable in 2026.
Authenticates the two peers and creates the IKE SA via Diffie-Hellman. Output: a secure control channel. No data flows yet. Lifetime ≈ 28800 s.
Negotiates the ESP SAs that carry real user data. Selectors (subnets/protocols/ports) must match exactly on both peers. Lifetime ≈ 1800 s.
Wraps IKE and ESP inside UDP 4500 when a peer sits behind NAT. FortiGate auto-detects and switches from UDP 500 to 4500 mid-Phase-1.
Dead Peer Detection — heartbeat over IKE. Default 20-second interval. If 3 misses, FortiGate tears the SA and re-negotiates. Catches dead far-ends fast.
Full IP-layer VPN over DTLS/TLS to FortiClient. Pushes split-tunnel routes and a virtual IP. Portal mode = web bookmarks only, no routing.
TOTP 2FA for SSL VPN and admin login. Soft token on phone (free with FortiClient) or hardware fob. Bound to the user, not the device.
IKE negotiation — see the 6-step handshake
The first time Suhail's the Pune branch FortiGate talks to Bangalore HQ, six discrete messages fly over UDP. Get the order right and you can debug any "tunnel won't come up" in under 90 seconds.
IKEv2 negotiates the whole tunnel in 4 messages (2 round-trips); IKEv1 main mode takes 9 messages and 3 round-trips. IKEv2 has built-in NAT-T, MOBIKE for roaming, native rekey without dropping the SA, and stronger anti-replay. The only reason to stay on IKEv1 is a legacy peer (old Cisco ASA pre-9.8 or a vendor box that never got an IKEv2 firmware). FortiGate also defaults Phase 1 lifetime to 86400 s — drop it to 28800 s to match the IKEv2 RFC recommendation and rotate keys more often.
Suhail's Phase 1 keeps failing in the FortiGate console with no SA proposal chosen. He flipped IKEv2 on his side; the partner team at the HQ swears their side is "the same". What does this error usually mean?
no SA proposal chosen is FortiOS's way of saying "your transform sets don't intersect". Wrong PSK shows as authentication failed; UDP 500 block shows as silent timeout; missing NAT-T shows as Phase 1 up but ESP not flowing. Verify with diag debug application ike -1; diag debug enable and align the proposals.Real config — IKEv2 site-to-site, both sides
Here is the minimum viable config for Suhail's tunnel. Both FortiGates need a Phase 1 (peer + auth + DH), a Phase 2 (selectors), and a static route pointing the partner subnet at the tunnel interface.
config vpn ipsec phase1-interface
edit "the enterprise-BLR-HQ"
set interface "wan1"
set ike-version 2
set peertype any
set proposal aes256gcm-prfsha256
set dhgrp 14
set remote-gw 203.0.113.10
set psksecret "Hcl@Br@nch2HQ#2026"
set dpd on-idle
set dpd-retryinterval 20
next
end
config vpn ipsec phase2-interface
edit "the enterprise-BLR-HQ-P2"
set phase1name "the enterprise-BLR-HQ"
set proposal aes256gcm
set pfs enable
set dhgrp 14
set keylifeseconds 1800
set src-subnet 10.20.10.0 255.255.255.0
set dst-subnet 10.10.0.0 255.255.0.0
next
end
config router static
edit 0
set dst 10.10.0.0 255.255.0.0
set device "the enterprise-BLR-HQ"
next
end
name peer status uptime p1/p2 the enterprise-BLR-HQ 203.0.113.10 up 00:00:17 1/1
Before you scroll — Suhail's HQ partner enables aggressive mode "for performance". The branch FortiGate sits on a static public IP 203.0.113.45. What's the security trade-off he just made?
▶ Watch the Phase 1 + Phase 2 drama — IKEv2 site-to-site
Suhail's Pune branch FortiGate negotiates with Bangalore HQ. Step through all 7 stages.
10.20.10.0/24 ↔ 10.10.0.0/16. Proposals match. PFS DH-14 fresh exchange.Suhail's tunnel reads "Phase 1 UP, Phase 2 DOWN" in the GUI for 5 minutes. He runs diag debug application ike -1; diag debug enable and sees negotiation result NOT NEGOTIATABLE on the P2 exchange. What is the most likely cause?
diag vpn ike gateway list on both sides and compare the src/dst subnet lines char-for-char.SSL VPN — tunnel vs portal, and why DTLS matters
Suhail's second project — 200 work-from-home users on FortiClient. SSL VPN has two flavours, and confusing them in an interview is an instant fail.
Tunnel mode gives the user a real Layer-3 VPN. FortiClient on the laptop creates a virtual adapter, gets a virtual IP from the SSL VPN pool, and the FortiGate pushes split-tunnel routes (e.g. 10.10.0.0/16 via tunnel). Every corporate-bound packet rides DTLS (UDP 443 by default for speed) or TLS (TCP 443 fallback). Browser-only apps, RDP, SSH, file shares — all of it works.
Portal mode is clientless — the user opens a browser, logs into the FortiGate's SSL VPN portal page, and clicks bookmarks: pre-defined RDP, SSH, HTTP/HTTPS shortcuts that the FortiGate proxies on the user's behalf. No virtual IP. No real routing. Useful for unmanaged BYOD laptops where you do not want to install FortiClient. Limited because anything not bookmarked is unreachable.
DTLS matters because tunnel-mode SSL VPN over TLS (TCP) suffers from "TCP-over-TCP" — when a user's RDP session inside the tunnel hits packet loss, both the inner TCP and the outer TCP retransmit, killing throughput. DTLS rides UDP so only the inner stream retransmits. FortiGate prefers DTLS on UDP 443; falls back to TLS on TCP 443 if UDP is blocked (think hotel WiFi, corporate proxies).
Suhail builds the SSL VPN portal on the Bangalore HQ FortiGate-100F (public 203.0.113.10:443). Tunnel mode, DTLS preferred. Split-tunnel: 10.10.0.0/16 via VPN, everything else direct. FortiClient pushed via Intune. Users log in with AD credentials + FortiToken Mobile TOTP (free with the FortiClient EMS license). Day-one rollout is smooth.
Day three, Suhail's manager forwards an alert from FortiGuard: CVE-2024-55591 IoC pattern detected on a sister FortiGate at the enterprise Chennai. Suhail's job pivots — every FortiGate in the org needs the symlink audit even though they all show "patched" in the dashboard.
The CVE-2024-21762 era — patched is not clean
2024 changed how every L2 thinks about FortiGate SSL VPN. Three incidents you must be able to talk through in any interview after Feb 2024.
A buffer-handling bug in the SSL VPN daemon (sslvpnd) on FortiOS 7.x and earlier allowed an unauthenticated remote attacker to write outside an allocated buffer and execute arbitrary code as root on the FortiGate. CVSS 9.8. Fortinet disclosed via PSIRT on 2024-02-08; the advisory explicitly noted "potentially being exploited in the wild" — i.e. it was a zero-day for weeks before the patch landed. CISA issued an emergency directive within 24 hours. Tens of thousands of devices were still vulnerable on Shodan weeks later.
Defensive lesson: patch to FortiOS 7.4.3 / 7.2.7 / 7.0.14 / 6.4.15 at minimum. If you cannot patch, disable SSL VPN (config vpn ssl settings → set status disable) or restrict source IPs via local-in policy until you can.
This is the trick every interviewer is testing for in 2026. Attackers who exploited CVE-2024-21762 (or earlier SSL VPN bugs going back to 2023) on un-patched FortiGates chmod'd a symlink inside the SSL VPN user web-mount pointing to the device's config tree. The symlink survives a FortiOS firmware upgrade because the SSL VPN user filesystem is preserved across patching. Orgs that patched to 7.4.3 and breathed easy continued to leak full config read access to the attacker.
The audit: diagnose sys ssl-vpn web-mode list-files and look for any symlink the attacker dropped. Fortinet's April 2025 PSIRT bulletin (FG-IR-24-015) ships a one-shot cleanup script — run it on every SSL-VPN-enabled FortiGate that was ever on a vulnerable build, not just the ones that fired IoC.
An authentication bypass via the Node.js websocket on the FortiGate's jsconsole management interface. Attackers crafted a CSF (Cluster Synchronization Framework) API call that the websocket accepted without auth, and used it to create a super-admin account on the device. Arctic Wolf and Fortinet correlated activity from at least November 2024 — two months before public disclosure.
IoCs to grep for: unexpected admin accounts (show system admin), new SSL VPN portal bookmarks created by an unknown user, abnormal jsconsole connections in execute log filter category event output, sudden config pushes timestamped outside business hours.
Suhail patches the the enterprise Chennai FortiGate to FortiOS 7.4.3 (post-CVE-2024-21762 fix). His CISO asks: "Are we definitely clean now?" What is the only correct answer?
▶ SSL VPN user flow — Suhail's WFH laptop
Suhail testing the rollout from his home WiFi (192.168.1.105, behind home NAT) into Bangalore HQ.
10.10.0.0/16 via tunnel · everything else direct to home gatewayhttps://10.10.5.20 · packet rides DTLS · Confluence rendersDebug a dead tunnel — settle Phase 1/2 in 90 seconds
Rishabh, an L3 at an Indian security firm Bangalore, does not argue about tunnels. He runs three commands.
diagnose vpn ike gateway list name the enterprise-BLR-HQ diagnose vpn tunnel list name the enterprise-BLR-HQ get vpn ipsec tunnel summary
vd: root/0 name: the enterprise-BLR-HQ version: 2 interface: wan1 9 addr: 203.0.113.45:500 -> 203.0.113.10:500 created: 17s ago IKE SA: created 1/1 established 1/1 time 17ms auth: psk DH group: 14 encryption: aes-256-gcm state: established
After any IPsec change, run on the branch FortiGate:
diagnose vpn ike gateway list name the enterprise-BLR-HQ — expect state: established, peer 203.0.113.10, DH group 14.
Then for Phase 2: diagnose vpn tunnel list name the enterprise-BLR-HQ — expect both src/dst subnet lines to match the HQ side exactly, and SA: created N established N.
Suhail's branch FortiGate sits behind an ISP modem doing NAT (CG-NAT is no, but the modem hands out 100.64.0.7 to the WAN1 interface). Phase 1 won't even start. What's the single setting most likely missing?
set nattraversal enable on the phase1-interface. Also confirm the modem is forwarding UDP 500 and UDP 4500 to the FortiGate WAN1 — most consumer modems block 4500 by default. The wrong fix is to enable policy-NAT on the IPsec firewall policy — that double-translates the source IP, breaks Phase 2 selectors, and gets you stuck in negotiation loops.
Suhail's CISO emails: "We are exposed to CVE-2024-55591 — is our SSL VPN safe?". Suhail's instinct is "yes, we patched". Why is that incomplete?
jsconsole — different vector from the SSL VPN data-plane CVE-2024-21762; he must confirm management access is restricted to a trusted-host list, not "any". (2) The Arctic Wolf timeline shows exploitation since November 2024 — two months before the public CVE — so the right question is "what is the IoC posture on every FortiGate we own?" not "are we patched today?". (3) Symlink persistence (FG-IR-24-015) means a patched FortiGate that was exploited in 2024 still leaks config until the symlink is removed. Suhail's reply should be: patched + trusted-host restricted + admin accounts re-baselined + symlink cleanup script run + monitoring on for IoC.
🤖 Ask the AI Tutor
Tap any question — instant context-aware answer. Tuned on FortiOS 7.4 / 7.6 docs + Fortinet PSIRT advisories.
Pre-curated answers grounded in FortiOS 7.4 / 7.6 admin docs + Fortinet PSIRT FG-IR-24-015. For complex prod issues, paste your diag vpn ike gateway list + diag vpn tunnel list output into chat.techclick.in.
📝 Final round — seven more
You've already answered 3 inline. Seven more. 70% (7 of 10) total marks this lesson complete on your Techclick profile. Tap Submit all answers at the end.
Self-explanation prompt
In 2-3 sentences, explain to a hypothetical batchmate: "Why does patching FortiOS 7.4.3 for CVE-2024-21762 not automatically make my FortiGate clean?" Writing it out cements the symlink-persistence idea faster than re-reading.
📖 Mini-glossary — terms used in this blog
- IPsec
- IETF protocol suite for encrypted, authenticated tunnels.
- IKE
- Internet Key Exchange — the control-plane protocol that builds IPsec SAs.
- Phase 1
- Authenticates peers and creates the IKE SA via Diffie-Hellman.
- Phase 2
- Negotiates the ESP SAs (selectors) that carry real user data.
- ESP
- Encapsulating Security Payload — IP proto 50, the data plane of IPsec.
- DH group
- Diffie-Hellman modulus size. DH-14 (MODP-2048) is the 2026 floor.
- PSK
- Pre-shared key — simple peer auth, painful at scale.
- PFS
- Perfect Forward Secrecy — fresh DH per rekey. Always enable.
- NAT-T
- NAT Traversal — wraps IKE/ESP in UDP 4500 when behind NAT.
- DPD
- Dead Peer Detection — heartbeat on the IKE channel.
- SSL VPN
- VPN over TLS/DTLS to a FortiClient or browser portal.
- DTLS
- TLS over UDP — avoids TCP-over-TCP meltdown for tunnel-mode.
- Tunnel mode
- Full IP-layer SSL VPN with virtual IP and split-tunnel routes.
- Portal mode
- Clientless SSL VPN — bookmarks only, no routing.
- FortiToken
- TOTP 2FA — soft on phone or hardware fob.
- FortiClient
- The Fortinet endpoint agent that establishes the SSL VPN.
- Dial-up VPN
- Many remote peers with dynamic public IPs into one central FG.
- Aggressive mode
- IKEv1 mode for dial-up; sends peer-ID early but is offline-crackable.
diag debug application ike -1 debug + an FG-IR-24-015 audit story.
What's next?
Blog 3 opens FortiGate HA — Active-Passive vs Active-Active, FGCP heartbeat, session sync, the override gotcha that flips your primary unit at the wrong moment.
📚 Sources
- Fortinet PSIRT — FG-IR-24-015 — Out-of-bounds Write in sslvpnd (CVE-2024-21762). fortiguard.fortinet.com/psirt/FG-IR-24-015
- Tenable Research Blog — CVE-2024-21762: Critical Fortinet FortiOS Out-of-Bounds Write Vulnerability. tenable.com/blog/cve-2024-21762-critical-fortinet-fortios-out-of-bounds-write-vulnerability
- The Hacker News — Fortinet Warns of New CVE-2024-21762 SSL VPN Zero-Day Exploited in the Wild. thehackernews.com
- Help Net Security — CVE-2024-55591: Critical FortiOS Auth Bypass Exploited Since November. helpnetsecurity.com
- Arctic Wolf Labs — CVE-2024-55591 FortiGate Auth Bypass Threat Activity Timeline. arcticwolf.com/resources/blog
- Rapid7 — Fortinet FortiOS CVE-2024-21762 Exploitation Detection Logic. rapid7.com/blog
- Fortinet Docs — IPsec VPN — Phase 1 + Phase 2 Configuration (FortiOS 7.4 / 7.6 Administration Guide). docs.fortinet.com
- Fortinet Docs — SSL VPN tunnel mode + portal mode + DTLS. docs.fortinet.com
- Fortinet Community — Troubleshooting Tip: IPsec Phase 1 + Phase 2 debug recipe. community.fortinet.com