Create an SSTP VPN Server in Windows Server 2016

I had already created an L2TP VPN server in Windows Server 2016 which worked great with my IOS devices but I found did not work so well with Windows 10.  Therefore I created an SSTP VPN Server to access my devices via my home broadband connection (Sky Fibre).  I found that this works perfectly with all my Windows 10 machines.  The main difference between L2TP and SSTP is that for SSTP we need to use certificates.  We will cover everything you need to get this up and running below.

Firstly build a Windows 2016 server, VM or physical it doesn’t really matter.  I used a VM as I can spin it up/down and snapshot as needed.  For notes on installing Windows 2016 Server please see here.

You then need to setup a Certificate Authority (Can be on the same server).  Please follow this guide for step by step instructions on setting up a CA to use with your SSTP VPN.

You then need to install the Remote Access role.  To do this open Server Manager and start the Add Roles and Features wizard.  Select the Remote Access Role and click Next.

Click Next again

Click Next again




Click Add Features and click Next

Click Next

Accept the Web Server Role service selections and click Next

Click Install

Wait for the installation to finish

Once the role has installed click the Open he Getting Started Wizard option from the server manager




Select Deploy VPN Only

You now have access to the Routing and Remote Access console

Right click on your server name and select Configure and Enable Routing and Remote Access

Click Next

If you only have one network interface select Custom configuration and click Next

Select VPN Access and click Next

.




Click Finish

Click Start service

Wait for the service to start

Right click on your server name and click Properties.  Leave the general tab as it is and click on Security

Ensure that you only have EAP and MS-CHAP v2 selected

We now need to issue a certificate to the VPN server to enable it to trust incoming SSTP connections.  To do this (on the VPN server) click Start>Type certlm.msc to open the local machine certificate mmc.

Right click on Certificates under Personal and click All Tasks>Advanced Operations>Create Custom Request




Click Next and Next again

Accept the defaults and click Next

Expand Details> Click Properties and enter the Friendly name as the VPN server’s external DNS name.  If you do not have one you can setup DuckDNS which is a free service as i did.  Then click the Subject tab

Add both the Common Name and DNS names as the VPN server’s external DNS name.  Then click the Extensions tab

Expand Extended Key Usage and add Client Authentication and Server Authentication, then click Ok and Next

Choose somewhere to save the certificate request and click Finish

Open the Certificate Authority mmc and right click on the server name.  Then go to All Tasks> Submit new request.  Open the request file that you just saved.

Click Pending Requests and you should see your certificate request in there.  Right click on it and click Issue

You can now go to issued certificates and double click on your issued certificate.  Click on the details tab and then click Copy to File

Accept the defaults and click Next.  Then save the certificate and click Finish

Open the certlm.msc snap-in again and right click on Certificates under personal.  Click import and import the certificate you just exported from the Certificate Authority console




Then go back to the Routing and Remote Access console properties and click the security tab.  Under SSL Certificate Binding select the certificate that you just created

 

Click the IPv4 tab and select Static address pool.  Enter a range of addresses to use for DHCP when on the VPN.

Select the Logging tab and check the Log additional Routing and Remote Access information box

Click OK and you will be prompted to restart the Routing and Remote Access Service, do this now.

Next we need to create a secure user account to access the VPN.  Click Start>Run and type compmgmt.msc to access computer management.  Right click on Users and click New User.  Give the user a name and a strong password.

Right click on the user account and click Properties.  Click the Dial-in tab and select Allow access, then click OK.  If you want to use NPS to control access at this point select Control access through NPS Network Policy.

As I do not have a fixed external IP address for this server and am sitting behind a NAT firewall (Provided by my broadband supplier Sky – which I can’t change) I will need to forward ports from my router to the RRAS VPN server.  To do this you will need to set up something like the below:

If you are forwarding all port 443 traffic to this server you may want to restrict access to IIS.  You can do this by opening IIS Manager and selecting the default website.  You can then click on IP Address and Domain Restrictions.

You can then add a Deny rule.  I added 0.0.0.0 (0.0.0.0) as I wanted to restrict all access to IIS.




Next, export the root certificate from your certificate authority by opening the CA console, right clicking on the server name and going to Properties.  Click the General tab and View Certificate.  Then click details and export the certificate to a file.

Import this to Windows 10 machine in the certlm.msc snap-in but add it to Certifiates under Trusted Root Certification Authorities.

Next you need to create a certificate request on your Windows 10 machine.

To do this (on the Windows 10 client) click Start>Type certlm.msc to open the local machine certificate mmc.

Right click on Certificates under Personal and click All Tasks>Advanced Operations>Create Custom Request

Click Next and Next again

Accept the defaults and click Next

Expand Details> Click Properties and enter the Friendly name as the Windows 10 machine’s name.   Then click the Subject tab

Add both the Common Name and DNS names as the VPN server’s external DNS name.  Then click the Extensions tab

Expand Extended Key Usage and add Client Authentication then click Ok and Next

Choose somewhere to save the certificate request and click Finish




Open the Certificate Authority mmc and right click on the server name.  Then go to All Tasks> Submit new request.  Open the request file that you just saved.

Click Pending Requests and you should see your certificate request in there.  Right click on it and click Issue

You can now go to issued certificates and double click on your issued certificate.  Click on the details tab and then click Copy to File

Accept the defaults and click Next.  Then save the certificate and click Finish

Open the certlm.msc snap-in again on the Windows 10 client and right click on Certificates under personal.  Click import and import the certificate you just exported from the Certificate Authority console

In Windows 10 click Settings> Network & Internet> VPN and click add a VPN connection.  Select Windows (built-in) as the VPN provider and give the connection a name of your choosing.  Enter the external DNS name of your VPN server and choose the VPN type as SSTP.

You can then enter the credentials of the VPN user account that we created earlier, then save the connection.

Next open the regedit and go to the below key:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Sstpsvc\Parameters

Add a DWORD called NoCertRevocationCheck and set it to a value of 1

It should now connect without any issues.




9 Replies to “Create an SSTP VPN Server in Windows Server 2016”

  1. I get error : A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.

    cant seem to fix it .

    1. You need to use a 3rd party trusted cert and import it into RRAS. That is the best way. Using a certificate authority, requires that all the issued certificates be imported in to each users certificate store. Using a 3rd party trusted CA issued cert, prevents this problem. SAN certs are so cheap now, or a wildcard will work as well.

    2. If an internal CA is in your certificate chain and not on the workstation you’re connecting with, you will need to install that certificate in the Trusted Root Certificate store.

      My guess is you’re not using a domain-joined computer for testing otherwise the CA would already be a trusted root CA. Either way, this should fix your issue.

  2. Hi, when i issue and export the client certificate, the expiration is only one year, there is the possibility to have the certificate issued more than one year expiration?
    Thanks
    Andrea

  3. Thank you for the concise details. I want to ask, following this setup will the VPN client machine automatically us the internet service on the VPN server or is there a further setup for this to happen?

  4. Good afternoon friend. Thanks for the tutorial.
    I noticed that just importing the CA to my client machine I can access it. Are these steps for creating a unique certificate for the customer really necessary?

Leave a Reply

Your email address will not be published. Required fields are marked *