Skip to main content
woodyman4916
New Member
Oct 31, 2026 8:43 PM UTC
Question

Windows Native Always On VPN Device Tunnel with FortiGate 7.4.13 — Lessons Learned

Mostly AI Generated, but results of my own work.
 

After considerable troubleshooting, I've successfully implemented Windows Native Always On VPN (AOVPN) Device Tunnel with FortiGate 7.4.13, using machine-certificate authentication, Microsoft Intune, and Active Directory authorization.

First, credit where it's due: Richard Hicks (richardhicks.com) has published excellent documentation on Windows AOVPN that helped tremendously.

Also, let's be clear: FortiClient already provides always-on, pre-logon VPN connectivity using machine certificates and, in my experience, does it better than Windows native AOVPN.

However, if you're like me and have valid reasons not to use FortiClient VPN, this post is for you.

Our Environment

We're using:

  • FortiGate running FortiOS 7.4.13

  • Windows native IKEv2 Device Tunnel

  • Enterprise CA with machine certificates deployed through Intune SCEP

  • Microsoft Entra hybrid-joined Windows computers

  • Active Directory LDAP for computer authorization

  • Intune-managed split-tunnel routes, NRPT, and trusted-network detection

Our implementation currently supports hybrid-joined devices because we use on-premises Active Directory computer identities for authorization.

For Microsoft's strong certificate mapping requirements, the Intune SCEP profile includes a URI SAN containing:

{{OnPremisesSecurityIdentifier}}

We also include the computer's FQDN as a DNS SAN, which is used by FortiGate for LDAP identity matching.

Microsoft documentation: Create SCEP certificate profiles in Intune.

FortiGate Phase 1 Configuration

The following is a sanitized example of our working configuration:

config vpn ipsec phase1-interface
edit "AOVPN-DEVICE"
set type dynamic
set interface "wan2"
set ike-version 2
set authmethod signature
set net-device disable
set mode-cfg enable

set ipv4-dns-server1 10.10.100.20
set ipv4-dns-server2 10.10.100.21

set proposal aes128-sha256 aes256-sha256 aes128gcm-prfsha256 aes256gcm-prfsha384 chacha20poly1305-prfsha256

set dpd on-idle
set dhgrp 14

set certificate "VPN-GATEWAY-CERT"
set peer "PKI-Windows-Native"

set assign-ip-from name
set ipv4-split-include "AOVPN-SPLIT-NETWORKS"
set ipv4-name "AOVPN-ADDRESS-POOL"

set client-auto-negotiate enable
set client-keep-alive enable
set dpd-retryinterval 60
next
end

Important observations:

  • We're using IKEv2 with certificate-based authentication.

  • The FortiGate validates the machine certificate against the configured PKI peer.

  • Group 14 is the working DH configuration.

  • Mode-CFG provides address assignment and DNS settings.

  • We found that Windows native AOVPN did not appear to install the split-tunnel routes defined through FortiGate Mode-CFG.

Because of that last point, we explicitly configured the required routes in the Intune VPN profile.

FortiGate Phase 2 Configuration

config vpn ipsec phase2-interface
edit "AOVPN-DEVICE"
set phase1name "AOVPN-DEVICE"

set proposal aes128-sha1 aes256-sha1 aes128-sha256 aes256-sha256 aes128gcm aes256gcm chacha20poly1305

set dhgrp 14
set keepalive enable
next
end

Our working FortiGate configuration uses Group 14 in both phases.

Note that IKE DH groups and Phase 2 PFS groups are separate settings; administrators should check the corresponding Windows configuration.

The example retains our original Phase 2 proposals, although I'd recommend removing the legacy SHA1 options where compatibility permits.

FortiGate PKI Peer Configuration

This is where we associate the trusted CA and configure LDAP identity validation.

config user peer
edit "PKI-Windows-Native"
set ca "ENTERPRISE-CA"
set cn-type FQDN
set mfa-mode subject-identity
set mfa-server "AD-IPSEC-LDAP"
next
end

The subject-identity configuration enables an additional certificate-identity lookup against LDAP.

In our case, we're using that integration to authorize the computer, rather than authenticate an interactive user.

Active Directory LDAP Authorization

This is one of the features I particularly like about the implementation.

We wanted more than simply accepting every valid machine certificate issued by our enterprise CA.

We wanted to control which computers were permitted to connect to each VPN tunnel.

We accomplished this with Active Directory security groups.

Here's our sanitized LDAP configuration:

config user ldap
edit "AD-IPSEC-LDAP"

set server "dc01.corp.example.com"
set secondary-server "dc02.corp.example.com"
set tertiary-server "dc03.corp.example.com"

set cnid "CN"
set dn "DC=corp,DC=example,DC=com"
set type regular

set username "svc-fortigate@corp.example.com"

set group-filter "(&(objectclass=group)(member:1.2.840.113556.1.4.1941:=CN=VPNComputers,OU=VPN,OU=Groups,DC=corp,DC=example,DC=com))"

set account-key-cert-field dnsname

set account-key-filter "(&(objectCategory=computer)(dNSHostName=%s)(memberOf=CN=VPNComputers,OU=VPN,OU=Groups,DC=corp,DC=example,DC=com)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))"

next
end

Note: LDAP credentials have been omitted. Configure secure LDAP transport and certificate validation as appropriate for your environment.

The two most important settings are:

Certificate identity mapping:

set account-key-cert-field dnsname

This tells FortiGate to use the certificate's DNS SAN when identifying the computer in Active Directory.

Computer authorization:

set account-key-filter "(&(objectCategory=computer)(dNSHostName=%s)(memberOf=CN=VPNComputers,OU=VPN,OU=Groups,DC=corp,DC=example,DC=com)(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))"

This filter requires:

  1. An Active Directory computer account.

  2. A matching dNSHostName from the certificate.

  3. Direct membership in the designated VPN security group.

  4. An enabled computer account.

This allows us to control VPN eligibility by adding or removing computers from an AD security group.

The separate group-filter shown above uses an AD transitive membership matching rule. It should be validated independently; the direct computer-group authorization check is in account-key-filter.

We use different AD security groups for different dial-up IPsec tunnels, allowing us to provide different privilege levels.

Intune VPN Configuration — Routing, NRPT, and Trusted Networks

Another important lesson: getting the IPsec tunnel established is only part of the configuration.

Although FortiGate supports Mode-CFG split-tunnel configuration, we found that Windows native AOVPN did not appear to install the advertised routes.

We had to explicitly configure the routes through Intune.

NRPT (Name Resolution Policy Table) is also essential in our environment because we use split tunneling and internal DNS namespaces.

We also use our corporate DNS suffix for trusted-network detection. This prevents AOVPN from automatically connecting when the device is already on our corporate network.

This is particularly straightforward in our single-domain Active Directory forest.

Here's a simplified, sanitized Windows VPNv2 ProfileXML example illustrating these settings:

<VPNProfile>
<NativeProfile>
<Servers>vpn.corp.example.com</Servers>
<NativeProtocolType>IKEv2</NativeProtocolType>
<Authentication>
<MachineMethod>Certificate</MachineMethod>
</Authentication>
<RoutingPolicyType>SplitTunnel</RoutingPolicyType>
</NativeProfile>

<AlwaysOn>true</AlwaysOn>
<DeviceTunnel>true</DeviceTunnel>

<DnsSuffix>corp.example.com</DnsSuffix>
<TrustedNetworkDetection>corp.example.com</TrustedNetworkDetection>

<Route>
<Address>10.10.0.0</Address>
<PrefixSize>16</PrefixSize>
</Route>

<Route>
<Address>10.20.0.0</Address>
<PrefixSize>16</PrefixSize>
</Route>

<DomainNameInformation>
<DomainName>.corp.example.com</DomainName>
<DnsServers>10.10.100.20,10.10.100.21</DnsServers>
</DomainNameInformation>
</VPNProfile>

This illustrates the client-side settings, rather than serving as a complete deployment-ready profile. Our production configuration includes additional routes, namespaces, and certificate-related settings.

A few recommendations:

  • Explicitly define the required VPN routes in Intune.

  • Configure NRPT for internal DNS namespaces.

  • Configure trusted-network detection to prevent unnecessary connections.

  • Verify the resulting Windows routing table and DNS configuration after connection.

Trusted-network detection uses the DNS suffix associated with the underlying network profile; it should be tested on both corporate and external networks.

FortiClient ZTNA Limitations

Unlike FortiClient-managed IPsec VPN, Windows native AOVPN doesn't provide the same FortiClient EMS ZTNA-tag integration.

We haven't been able to use those tags in firewall rules for native Windows VPN connections as we do with FortiClient.

Our workaround is to create separate dial-up IPsec tunnels for different privilege levels.

Each tunnel has a corresponding AD computer security group, and we apply FortiGate firewall policies based on the source IPsec interface.

This works, although it isn't as flexible as FortiClient's endpoint-aware access controls.

The Biggest Troubleshooting Lesson: DH Group 19 vs. 14

This one consumed considerable time.

Initially, we were using ECP256 (DH Group 19).

The FortiGate accepted the initial IKE proposal, but the tunnel wouldn't establish.

Windows produced several misleading errors:

628   - The specified port was disconnected
13806 - IKE failed to find a valid machine certificate
13819 - Invalid certificate type
13849 - New policy invalidated existing SAs

We spent considerable time validating certificates, CA chains, CRLs, private keys, and Windows IKEEXT diagnostics.

The machine certificate was valid. We even confirmed that SYSTEM could successfully sign using the RSA private key.

Ultimately, switching to DH Group 14 restored connectivity.

Our working FortiGate configuration uses Group 14 in both Phase 1 and Phase 2.

I'm not suggesting that Group 14 is universally better or that Group 19 is incompatible with FortiGate. Group 19 actually offers higher nominal cryptographic strength.

However, if you're experiencing a similar problem with Windows native IKEv2 and FortiOS 7.4.13, it's something worth investigating.

Final Thoughts

Windows native AOVPN with FortiGate works, but there are some gotchas.

Certificate trust: Make sure Windows trusts the complete FortiGate gateway certificate chain, including any intermediate and root CAs. A valid machine certificate isn't sufficient if Windows doesn't trust the gateway.

Intune: Don't overlook routing, NRPT, and trusted-network detection.

Active Directory: The combination of account-key-cert-field dnsname and account-key-filter provides useful computer-based authorization.

ZTNA: Native Windows AOVPN doesn't provide equivalent FortiClient EMS endpoint-tag integration in our implementation.

Cryptography: Don't assume certificate-related errors mean your certificates are broken. In our case, changing from DH Group 19 to Group 14 resolved the problem.

FortiClient is still my preferred solution for this functionality when it can be used. But if you have reasons to avoid it, Windows native AOVPN is a workable alternative.

Hopefully this saves someone else the hours I spent troubleshooting!

Special thanks again to Richard Hicks — richardhicks.com for his excellent Windows Always On VPN documentation.

All configurations have been sanitized and are provided as examples. Validate them against your environment and security requirements before deploying.

    1 reply

    Jean-Philippe_P
    Staff & Editor
    Staff & Editor
    Nov 4, 2026 1:08 PM UTC

    Hello and thanks woodyman4916,

    This will be a great help for issues of users, thanks for sharing it!

    Jean-Philippe - Fortinet Community Team
    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024