FortiGate: SSL-VPN With FortiClient (AD Authenticated)

FortiGate Remote Access (SSL–VPN ) is a solution that is a lot easier to setup than on other firewall competitors. Here’s how to setup remote access to a FortiGate firewall device, using the FortiClient software, and Active Directory authentication. This is what my topology looks like;

Remote SSL-VPN with FortiClient

Note: I’ve changed the FortiGates default management HTTPS port from 443 to 4433 (before I started). This was to let me use the proper HTTPS port of 443 for remote access SSL VPN. I suggest you also do this, as running SSL-VPN over an ‘odd’ port may not work from some locations. See the following article;

Certificate: I’m also using a self signed certificate on the FortiGate, in a production environment you may want to purchase a publicly signed one!

Step 1: FortiGate LDAPS Prerequisites

Before we start, we need to make sure your firewall can resolve internal DNS. (Because the Kerberos Certificate name on your Domain Controller(s) gets checked, when doing LDAPS queries, if you DON’T want to do this then disable server identity check when you setup your LDAP server below). Or you can add the IP address to the servers Kerberos certificate as a ‘Subject Alternative Name‘ but thats a bit bobbins IMHO

Network > DNS > Specify > Add in your ‘Internal” DNS servers > Apply.


Add Internal DNS Server Fortigate

Certificate Prerequisites

To perform LDAPS the FortiGate needs to trust the certificate(s) that our domain controller(s) use. To enable that you need a copy of the CA Certificate, for the CA that issued them. At this point if you’re confused, you might want to run through the following article;

So to get a copy of your CA cert on a Windows CA server use the following command;

certutil -ca.cert My-Root-CA-Cert.cer


Windows Export CA Certificate

To ‘Import‘ the certificate into the Fortigate > System > Certificates > Import > CA Certificate.

Fortigate upload CA Certificate

File > Upload > Browse to your CA Certificate > Open > OK.

Fortigate Import CA Certificate

Take note of the certificate name, (CA_Cert_1 in the example below,) you will need this information below.

Fortigate Get Name CA Certificate

Step 2: Allow FortiGate LDAPS Authentication (Active Directory)

User & Authentication > LDAP Servers > Add.

Add LDAPS Server Fortigate

Click ‘Test Connectivity‘ It should say successful, then you can check some other domain user credentials as a test > OK.

Create LDAPS Server Fortigate

Domain / Active Directory Setup

Over in my Active Directory I’ve created a security group called GS-VPN-Users, and put my user object into it.

Fortigate AD Group Authentication

Now I need to create a FIREWALL GROUP and add my ACTIVE DIRECTORY GROUP to that. User & Authentication > User Groups > Create New.

Fortigate AD LDAPS Groups

Remote Groups > Add.

Fortigate Firewall Group

Change the Remote Server drop down list to be your LDAPS Server > Browse to your ACTIVE DIRECTORY GROUP, right click and Add Selected (Cheers, that took me three goes to find FortiNet!) > OK.

Fortigate Add AD Group to Firewall Group

All being well you should see your LDAPS server AND the distinguished name of your AD group, (check that’s not missing!) > OK.

Fortigate Remote VPN with AD Groups

Step 3: Setup FortiGate SSL-VPN

First we need an SSL Portal > VPN > SSL-VPN Portals > Create New.

Fortigate Source IP Pools

Fortigate Source IP Pools Address

Fortigate VPN IP Pools Address

Enter a portal message, (the header on the page once a remote user connects) > Enable FortiClient download > OK.

Fortigate VPN IP Pools Address

If you see the following error, that’s because on some smaller firewalls, (like the 40F) there can only be one, so you need to edit the one that is there by default.

Maximum number 0f entries has been reached.

SSL Maximum number of entries has been reached

FortiGate SSL-VPN Settings

VPN > SSL-VPN Settings > Listen on Interfaces.

Fortigate SSL-VPN Settings

Set to the outside (WAN) interface > Address Range > Specify custom IP Ranges > IP Ranges > Add in the pool you created above.

Fortigate SSL-VPN Interface

DNS Server > Specify > Add in your internal DNS servers > Authentication Portal Mapping > Create New.

Fortigate SSL-VPN DNS and Portal Mapping

Apply (Note: If it complainsAll Other User/Group‘ is not configured, set that to web-access (as shown).

Fortigate Remote Access VPN

FortiGate SSL-VPN Firewall Policy

Policy & Objects > Firewall Policy (or IPV4 Policy on older versions) > Create New.

Fortigate SSL-VPN Firewall Policy

Fortigate SSL-VPN No NAT

Fortigate SSL-VPN Logging

Step 4: Test FortiGate SSL-VPN

From your remote client, browse to the public IP/FQDN of the firewall and log in, you should see the SSL-VPN portal you created, and have the option to download the FortiClient (VPN) software for your OS version.

Download FortiClient

Install the FortiClient (Note: This is only the VPN component not the full FortiClient).

Install FortiClient

Remote Access > Configure VPN.

Configure FortiClient

Then test connection, make sure you can ping internal IP addresses and DNS names.

Connect FortiClient SSL-VPN

Related Articles, References, Credits, or External Links

Author: PeteLong