Windows 10 sstp client to mikrotik

Настройка SSTP сервера и клиента на Микротик, создание сертификатов и подключение к нему по VPN компьютера под управлением Windows 10.

Сегодня поговорим о том как настроить SSTP Server на MikroTik. Расшифровывается аббревиатура как Secure Socket Tunneling Protocol – PPP туннель аутентифицирует через TLS канал. Использует TCP порт 443 и фактически проходит через все фаерволы и прокси сервера. Впервые был представлен в Windows Vista SP1. С того момента прошло много времени, но не зря, т.к. все поняли очевидные его плюсы, а именно:

  • Безопасный, используются алгоритмы AES;
  • Хорошо проходим, тесты показывают установку соединения из Тайландского WiFi в отеле и обычного Украинского провайдера;
  • Полностью поддерживается MS Windows.

Из минусов

  • работает на одном ядре;
  • уязвим перед некоторыми атаками MITM (скорее фантастика).

В сегодняшней статье мы рассмотрим настройку SSTP сервера на роутере микротик с версией 6.46.4 и клиента на операционной системе Windows 10 Pro 1909.  Идеальное решение для предоставления пользовательского подключения к корпоративной сети и не только. Прикрутив коммерческий сертификат, вы снимаете с себя ручное добавление его в машинах Windows. Но в качестве демонстрации, мы будем использовать само подписанный. Так же возможно настроить Site to Site туннель между двумя Mikrotik, причем без них, что крайне не рекомендую.

Содержание

  1. Схема сети
  2. Настройка сервера SSTP
  3. Настройка SSTP клиента на Микротик
  4. 89 вопросов по настройке MikroTik

Схема сети

SSTP топология

  • Сервер SSTP имеет адрес 192.168.100.2;
  • Клиентский ПК получает из пула 192.168.1.0/24;
  • Маршрутизируемая сеть между удаленными площадками.

Если вы хотите углубить свои знания по работе с роутерами MikroTik, то наша команда рекомендует пройти курсы которые сделаны на основе MikroTik Certified Network Associate и расширены автором на основе опыта . Подробно читайте ниже.

Настройка сервера SSTP

Конфигурация устройства проста. Имеем RouterBoard с настроенным выходом в интернет. Подключение будет происходить по сертификату, в котором вместо имени указан IP адрес. Первым делом нужно создать сертификат центра сертификации. Переходим в System – Certificates и создаем новый.

Открываем меню сертификатов

В поле Name указываем понятное имя, отображаемое в списке;

  • Country – двухбуквенное значение;
  • State, Locality, Organization, Unit – по своему усмотрению;
  • Common Name – самое важное, уникальное имя. Если у вас есть доменное имя vpn.test.ru, то вписываете его сюда. Если же его нет, но есть публичный статический адрес, то пишите его. Представим, что наш адрес такой.

Вы так же можете указать длину ключа и срок действия.Создаем корневой сертификат

Далее переходим в Key Usage. Снимаем галки со всего, оставляя только на crl sign и key cert. sign.

Убираем не нужные опции

Жмем Apply и Sign. В новом открывшемся окне подписания, стартуем процесс подписи кнопкой Start.

Запускаем генерацию

По завершении увидим в Progress состояние done и аббревиатуру KAT возле CA.

Проверяем создание

Далее создаем сертификат самого сервера SSTP, который будет указан в качестве основного на интерфейсе. Жмем плюс и заполняем все поля аналогично предыдущему, за исключением понятного имени.

Создадим сертификат сервера

На вкладке Key Usage добавляем галочки tls client и tls server.

Выставляем нужные опции

Жмем Apply и Sign. В открывшимся окне подписи в поле CA выбираем корневой сертификат и стартуем процесс.

Подписываем с помощью СА

Проверим.

Смотрим на список выпущенных сертификатов

Далее создадим профиль подключения для клиентов. PPP – Profiles. Указываем понятное имя профиля;

  • адрес в туннеле;
  • разрешаем TCP MSS;
  • запрещаем UPnP.

Создаем новый профиль SSTP

В Protocols:

  • Use MPLS – запретить;
  • Use Compression – разрешить;
  • Use Encryption – разрешить;

Указываем дополнительные параметры Protocols

В Limits выставляем Only One в no.

Правим ограничения

Создадим пользователя в Secrets.

  • Name – имя пользователя, регистр имеет значение;
  • Password – пароль;
  • Service – SSTP;
  • Profile – созданный выше;
  • Remote Address – адрес в туннеле.

Создаем пользователя SSTP

Сохраняем и переходим в PPP – interfaces. Нас интересует вкладка SSTP Server.

Открываем PPP интерфейсы

Открыв ее, указываем следующие значения:

  • Enable – ставим галочку;
  • Default Profile – ранее созданный;
  • Authentication – mschapv2;
  • Certificate – Server;
  • Force AES, PFS – включаем.

Включаем SSTP

Если страшно, то можно выставить TLS Version в only 1.2. Двигаемся дальше к фаерволу. Просто одно правило. Разрешить входящий трафик на 443 порт – все.

Разрешаем SSTP

Настройка SSTP клиента на Микротик

Для дальнейшей конфигурации нам нужен сертификат центра сертификации добавить в доверенные компьютера. Иначе начнется песня со списком отзывов и в этом роде. Конечно, таких проблем не будет, используя коммерческий. Но его нужно сначала выгрузить. Открываем System – Certificates, выбираем CA и жмем Export.

Экспортируем CA сертификат

В Files должен появится экспорт. Передаем его любым удобным способом на клиентскую машину.

Копирование на ПК пользователя

Далее вы можете вручную его добавить в доверенные ПК, но я предпочитаю это делать скриптом. Сохраняем в формате .bat

Создаем на рабочем столе папу CA, копируем туда CA.crt и запускаем из-под администратора батник.

cd «%UserProfile%DesktopCA»

certutil -addstore «Root» CA.crt

Проверяем что все хорошо.

Проверяем импорт CA

Далее переходим в Центра управления сетями и общим доступом – Создание и настройка нового подключения или сети.

Создаем новое подключение

Подключение к рабочему месту.

Выбираем подключение к рабочему месту

Использовать мое подключение к Интернету.

Используем свое подключение к Интернету

Указываем адрес и имя будущего интерфейса.

Указываем адрес сервера и имя интерфейса

Переходим в Изменение параметров адаптера» и открываем свойства VPN интерфейса. На вкладке «Тип VPN» переключить с автоматически на SSTP, Проверку подлинности переключить на Microsoft CHAP версии 2.

Выбираем клиент SSTP и MS-CHAPv2

Сохраняем и пытаемся подключиться.

Вводим логин и пароль SSTP

На момент написания статьи у меня вышла такая ошибка.

Ошибка срока действия сертификата

Это было связанно со временем. Т.к. в виртуальных машинах оно идет по-другому. Открыв свойства сертификата, заметил, что срок, с которого действителен еще не наступило. Исправив время на правильное, все заработало. Вывод, не используйте само подписанные. Проверим подключение на клиенте и сервере.

Проверим интерфейс на Windows

Проверим интерфейс на Mikrotik

На этом пожалуй все, в этой статье мы показали как можно легко создать SSTP сервер на роутере Микротик и подключить к нему клиента Windows 10. Спасибо за внимание и до новых встреч.

89 вопросов по настройке MikroTik

Вы хорошо разбираетесь в Микротиках? Или впервые недавно столкнулись с этим оборудованием и не знаете, с какой стороны к нему подступиться? В обоих случаях вы найдете для себя полезную информацию в курсе «Настройка оборудования MikroTik». 162 видеоурока, большая лабораторная работа и 89 вопросов, на каждый из которых вы будете знать ответ. Подробности и доступ к началу курса бесплатно тут.

Setting SSTP VPN Client in Windows is more complicated than setting a PPTP VPN Client. This happens because the use of SSTP VPN is much more secure (secure) than PPTP VPN, where the SSTP VPN connection in Windows must use SSL Certificate (Secure Sockets Layer). Another thing with PPTP VPN that does not need to bother using SSL Certificate, just a little setting can already connect.

In this Mikrotik Tutorial, we will discuss Tutorial How to Setting SSTP VPN Client in Windows 10 by first create SSL Certificate from Mikrotik Device. Before proceeding to this Tutorial, make sure you have read the previous Mikrotik Tutorial about:

Creating SSL Certificates CA, Server, and Client in Mikrotik

1. Create an SSL Certificate in Mikrotik for CA (Certificate Authority). Go to System Menu -> Certificates -> Add new certificate with detail as below:

CA (Certificate Authority)
CA (Certificate Authority)

Noteworthy is the Name and Common Name (CN) fields.

  • In the column, Name fill CA.
  • In the Common Name, field fill in the IP Address (public) or domain name of the SMTP Server.
  • For other columns please tailored to your respective data

2. Create an SSL Certificate for Client and Server. The way is the same as the first step, just replace the Name and Common Name.

 SSL Certificate for Client and Server. 
SSL Certificate for Client and Server.

 SSL Certificate for Client and Server. 

3. Sign the third SSL Certificate by clicking the Sign option on each certificate.

SSL CA Certificate Sign:

At the time of sign, in the Certificate column select, CA -> Column CA CRL Host fill in the Public Address IP or domain name SSTP Server

SSL CA Certificate Sign
SSL CA Certificate Sign

Sign Certificate SSL Server:

At sign in, in the Certificate field select Server -> CA column: select CA -> CA CRL Host: empty

Sign Certificate SSL Server
Sign Certificate SSL Server

3. After Certificate in Sign, make sure everything is already marked T which means Trusted. If not, go to its certificate -> check Trusted

4. Export Certificate of CA and its Client. Right, click on Certificate -> select Export option.

Export Certificate
Export Certificate

5. The Export Certificate results will appear in the Files menu with the .crt extension. Copy the Certificate file to the computer.

6. Paste the Certificate file to one of the Folders on the Computer. Then Install both the Certificate by right click -> Install Certificate

7. Create the DHCP VPN IP Pool :

IP Pool
IP Pool

8. Create the PPP Profile

 PPP secret (user/client)
PPP secret (user/client)

9.  Create   a  PPP secret (user/client)

 PPP secret (user/client)

10.  Configre and enable the SSTP server:

11.Create  SSTP    firewall  filter  and  nat  rules

Select [IP > Firewall]

In this example, keep in mind that once the VPN is established, the VPN client(s) will be pulling IP addresses from the previously created DHCP VPN IP Pool (10.10.100.10 – 10.10.100.254).

WINDOWS 10: INSTALL THE “CA” CERTIFICATE

We’ve completed the SSTP VPN setup for SiteX on the Mikrotik and will now need to configure the VPN on the client-side for ClientX’s Windows 10 machine. Earlier in this guide, we exported the “CA” certificate using the MikroTik at SiteX.

  1. In Winbox, select Files on the left-hand side. If you’ve been following the naming conventions of this guide, the file should be named “cert_export_CA.crt”. Drag or Download (right-click > download) the file to a safe location on your computer.
  2. Now that the CA certificate has been downloaded from the MikroTik, we will need to transfer the certificate to ClientX’s Windows 10 machine, I’ll let you decide how this is done.
  3. After transferring the CA certificate to ClientX, right-click on the certificate and select “Install Certificate” from the context menu and use the following screenshots below to complete the CA certificate setup for ClientX’s SSTP VPN:

Содержание

  1. Настройка SSTP VPN-сервера на Mikrotik для подключения из Windows 10
  2. MikroTik SSTP VPN Server Configuration with Windows 10
  3. How SSTP Connection Established
  4. SSTP VPN Server and SSTP Client Configuration
  5. Part 1: SSTP Server Configuration in MikroTik Router
  6. Part 2: SSTP Client Configuration in Windows 10
  7. Installing CA Certificate in Windows 10
  8. SSTP Client Configuration in Windows 10
  9. How to Setup SSTP VPN Client in Windows Using Certificate from Mikrotik
  10. Creating SSL Certificates CA, Server, and Client in Mikrotik
  11. SSL CA Certificate Sign:
  12. Sign Certificate SSL Server:
  13. Select [IP > Firewall]
  14. WINDOWS 10: INSTALL THE “CA” CERTIFICATE
  15. WINDOWS 10: CREATE THE VPN/NETWORK ADAPTER (NON-SPLIT TUNNEL)
  16. Manual:Interface/SSTP
  17. Contents
  18. Summary
  19. Certificates
  20. Certificate error messages
  21. Hostname verification
  22. SSTP Client
  23. Properties
  24. Quick example
  25. SSTP Server
  26. Server configuration
  27. Monitoring
  28. Application Examples
  29. Connecting Remote Client
  30. Site-to-Site SSTP

Настройка SSTP VPN-сервера на Mikrotik для подключения из Windows 10

Это перевод статьи “Mikrotik: Setup SSTP Server for Windows 10 client” из блога dr0u с моими мелкими правками.

Если вы хотите поблагодарить автора, вы можете зайти к нему на сайт и понажимать рекламные ссылки. Если вы хотите поблагодарить меня за перевод или сообщить мне какие-либо замечания, вы можете сделать это здесь же в комментариях или написать мне в LinkedIn, ссылка на который есть в правой части сайта.

Простая инструкция по построению туннеля между компьютером с Windows 10 и роутером Mikrotik с помощью SSTP.

Для начала немного о том, как работает SSTP.

Нажми здесь, чтобы развернуть много букв и картинок

Для соединения нам нужны:

Если вы организуете туннель между двумя устройствами Mikrotik, вам также нужен клиентский сертификат, но в нашем случае мы организуем туннель с Windows 10, и сертификат клиента нам не нужен.

Шаг 0. Прежде всего, у вы должны располагать “белым” IP-адресом или зарегистрировать себе доменное имя на одном из сервисов, предлагающих услуги динамического DNS. Когда мы будем делать сертификаты, нам понадобится указать это в поле CN, по этому полю клиент будет проверять, туда ли он подключается и тот ли это сертификат. Имя сертификата и имя соединения не обязаны быть одинаковыми.

Шаг 1. Генерируем сертификат CA на роутере Mikrotik.

Заполняем поля. Первый важный момент – это “белый” адрес или динамическое днс-имя, о котором я говорил ранее. Его надо указать в поле Common Name. Второе – срок действия можно указать поболее года, я просто добавил 0 и получил 3650 дней

001

На вкладке Key Usage нужно убрать лишние галки и оставить только crl sign и key cert. sign.

002

Нажмите Apply, потом Copy, чтобы приступить к созданию сертификата сервера и не заполнять одно и то же по второму разу.

Шаг 2. Генерируем сертификат сервера.

Если вы нажали Copy на прошлом шаге, то у нас уже практически всё готово, надо лишь изменить пару вещей.

Поле Common name на данном этапе не имеет значения, так что можете поставить такое же имя, как у сертификата.

003

То, что нам нужно обязательно сделать – снять все галки на вкладке Key Usage. Нажмите OK, потом откройте сертификат ещё раз и убедитесь, что все галки на этой вкладке сняты.

Шаг 3. Подписываем наш самоподписанный сертификат CA.

004

Откройте сертификат CA и нажмите Sign. Мой сертификат называется “test”, поскольку он создаётся в тестовых целях, вам стоит назвать его CA или как-нибудь вроде этого.

CA CRL Host – это тот адрес, по которому будет проверяться, не отозван ли сертификат. Укажите в этом поле ваш IP-адрес или динамическое доменное имя. Поле CA должно быть пустым.

Нажмите Sign, дождитесь завершения операции, закройте окно подписи и убедитесь, что в поле “trusted” стоит галка.

005 006

К этому моменту вы не можете ничего поменять в сертификате, а в списке сертификатов у вашего сертификата стоят пометки KAT (Private Key, Authority, Trusted).

Шаг 4. Теперь у нас есть корневой сертификат (CA), пора подписать сертификат сервера.

Заходите в сертификат сервера, жмите Sign, и в поле CA выберите наш первый сертификат – CA.

007

У этого сертификата будет пометка KI (Private Key, Issued).

На этом с созданием сертификатов покончено.

Шаг 5. Включение сервера SSTP и создание пользователей.

Заходите в PPP и нажимайте кнопку SSTP Server. Оставьте только галку mschap2 в разделе Authentication, остальные нужно убрать, если стоят. Выберите ваш сертификат CA в поле Certificate, нажмите OK и переходите на вкладку Secrets.

008

Secrets – это имена пользователей, пароли и данные для подключения для пользователей туннелей на вашем роутере.

Нажмите плюс, чтобы добавить пользователя.

009 1

Шаг 6. Убедитесь, что в вашем файрволе открыт порт TCP:443 в цепочке input.

Шаг 7. Экспорт сертификата и использование его в нашем клиенте Windows 10.

010

Теперь заходите в Files и копируйте сертификат CA на вашего клиента Windows.

Кликайте по нему правой кнопкой и жмите “установить”.

011

Следуйте инструкциям на экране, сертификат нужно установить в хранилище “Доверенные корневые центры сертификации” на локальном компьютере.

012 013

Нажмите Win+R запустите команду certlm.msc, это откроет хранилище сертификатов Windows. Убедитесь, что ваш сертификат установился в нужное хранилище. Имейте в виду, что имя сертификата – это то, что мы указывали в поле Common Name, а не имя файла или имя сертификата на роутере.

Шаг 8. Создаём подключение SSTP в Windows.

014

Жмите “Сохранить”, выбирайте своё подключение и нажимайте “подключить”.

Источник

MikroTik SSTP VPN Server Configuration with Windows 10

VPN (Virtual Private Network) technology provides a secure and encrypted tunnel across a public network. So, a private network user can send and receive data to any remote private network through VPN tunnel as if his/her network device was directly connected to that private network.

Secure Socket Tunneling Protocol (SSTP) transports PPP tunnel over TLS channel. SSTP uses TLS channel over TCP port 443. So, SSTP VPN can virtually pass through all firewalls and proxy servers. Because of using TLS channel, encrypted data passes over SSTP Tunnel. So, there is no chance to steal data by a middle man attacker and data can send and receive across public network safely. MikroTik SSTP Server can be applied in two methods.

The goal of this article is to connect a remote client device over secure SSTP VPN Tunnel across public network. So, in this article I will only show how to configure MikroTik SSTP VPN Server for connecting a remote workstation/client (Windows 10 Client).

How SSTP Connection Established

To establish a SSTP VPN tunnel across public network, the following mechanisms are occurred.

Network Diagram

To configure a Client-Server SSTP VPN Tunnel between a MikroTik Router and a Windows 10 SSTP Client, we are following the below network diagram.

In this network diagram, a MikroTik Router’s ether1 interface is connected to public network having IP address 117.58.247.198/30 and ether2 interface is connected to LAN having IP network 10.10.11.0/24.

We will configure SSTP Server in this MikroTik Router on TCP port 443. So, Windows 10 SSTP Client can be connected to this SSTP Server and can be able to access remote network resources as if the device is connected to that remote network.

SSTP VPN Server and SSTP Client Configuration

We will now start SSTP Server and Client configuration. Complete SSTP configuration can be divided into two parts.

Part 1: SSTP Server Configuration in MikroTik Router

According to the network diagram, MikroTik Router is our SSTP VPN Server. So, we will enable and configure SSTP VPN Server in MikroTik Router. It is assumed that MikroTik WAN and LAN networks have been configured and are working without any issue.

Complete MikroTik SSTP Server configuration can be divided into the following three steps.

Step 1: Creating TLS Certificate for SSTP Server

SSTP Server configuration requires TLS certificate because SSTP VPN uses TLS certificate for secure communication. MikroTik RouterOS v6 gives ability to create, store and manage certificates in certificate store. So, we will create required SSTP Server certificate from MikroTik RouterOS. SSTP Server requires two types of certificates:

Creating CA certificate

MikroTik RouterOS provides a self-signed certificate and self-signed certificate must have a CA (Certification Authority) Certificate to sign Server Certificate. This CA certificate will also be installed in SSTP Client devices otherwise Server Certificate cannot be verified. The following steps will show how to create a CA certificate in MikroTik RouterOS.

Creating Server Certificate

After creating CA certificate, we will now create Server Certificate that will be signed by the created CA. The Server Certificate will be used by SSTP Server. The following steps will show how to create Server Certificate in MikroTik RouterOS.

SSTP Server is now running in MikroTik Router. As MikroTik SSTP VPN is limited to use username and password for successful VPN connection, we will now create PPP users who will be able to connect to MikroTik SSTP Server and get IP information.

Step 3: Creating SSTP Users

MikroTik SSTP uses username and password to validate legal connection. So, we have to create username and password to allow any user. The complete user configuration for SSTP Server can be divided into the following three parts.

IP Pool Configuration

Usually multiple users can connect to SSTP Server. So, it is always better to create an IP Pool from where connected user will get IP address. The following steps will show how to create IP Pool in MikroTik Router.

User Profile Configuration

After creating IP Pool, we will now configure user profile so that all users can have similar characteristics. The following steps will show how to configure user profile for SSTP Users.

SSTP User Configuration

After creating user profile, we will now create users who will be connected to SSTP Server. The following steps will show how to create SSTP users in MikroTik RouterOS.

We have created a user for SSTP Server. Similarly, we can create more users that we require.

SSTP Server configuration in MikroTik Router has been completed. In the next part we will configure SSTP Client in Windows 10 Operating System.

Part 2: SSTP Client Configuration in Windows 10

After configuring SSTP Server in MikroTik Router, we will now configure SSTP Client in Windows 10 Operating System. SSTP Client configuration in Windows 10 can be divided into the following two steps.

Installing CA Certificate in Windows 10

Exported CA Certificate must be installed in Windows Trusted Root Certification Authorities otherwise SSTP Client cannot verify SSTP Server Certificate. To install CA Certificate in Windows 10, do the following steps.

You will now find Certificate Import Wizard window and it will ask for choosing certificate Store Location. From Sore Location panel, choose Local Machine radio button and then click Next button.

The next window will ask for choosing a specific certificate store. Exported CA must be placed in Trusted Root Certification Authorities store. So, click on Place all certificate in the following store radio button and then click on Browse button and choose Trusted Root Certificate Authorities and then click Next button.

The next Certificate Import Wizard will show a summery and ask to click Finish button. So, click Finish button and you will find a certificate importation successful message.

SSTP Client Configuration in Windows 10

After importing CA certificate in Trusted Root Certification Authorities, we will now configure SSTP Client in Windows 10 Operating System. The Following steps will show how to configure SSTP Client in Windows 10 OS.

How to Configure MikroTik SSTP VPN Server with Windows 10 Operating System has been discussed in this article. I hope you will now be able to configure SSTP Server and Client with MikroTik Router and Windows 10 Operating System. However, if you face any confusion to configure SSTP VPN Server and Client, feel free to discuss in comment or contact me from Contact page. I will try my best to stay with you.

Источник

How to Setup SSTP VPN Client in Windows Using Certificate from Mikrotik

Creating SSL Certificates CA, Server, and Client in Mikrotik

Creating SSL Certificates CA 1

SSL Certificate for Server 1

SSL CA Certificate Sign:

Sign Certificate SSL Server:

Sign Certificate SSL Server 1

Export Certificate file

MIKROTIK CREATE THE PPP PROFILE 1

PPP secret user client

10. Configre and enable the SSTP server:

Select PPP on the left-hand side of Winbox and navigate to the Interface tab. Select the SSTP Server button and apply the following settings to configure/enable the SSTP Server. Note that the Default Profile field is using the recently created SSTP01 profile and that the Certificate field is using the “Server” certificate that was created at the beginning of this guide. Also, notice the port that is being used – port 443. We’ll be using this port in the next step to create the firewall rule.

SSTP server

NOTE 04/25/18: In the screenshot above, TLS Version is currently set to “only-1.2”. The VPN connection will fail if the Operating System does not support TLS 1.2. I ran into this issue with Windows 7 SSTP clients. To resolve the connection issue, I changed this particular setting from “only-1.2” to “any”.

11.Create SSTP firewall filter and nat rules

Select [IP > Firewall]

In this example, keep in mind that once the VPN is established, the VPN client(s) will be pulling IP addresses from the previously created DHCP VPN IP Pool (10.10.100.10 – 10.10.100.254).

FIREWALL FILTER AND NAT RULESFIREWALL FILTER AND NAT RULES 1

The following commands will add additional rules that will allow traffic from the VPN’s subnet to/through the router. Once the rules have been created, they need to be placed under the previously created “Allow SSTP” rule (the screenshots above). Again, these rules are very broad, they will allow all traffic from the VPN’s subnet to/through the MikroTik. These rules may need to be modified or additional rules created to comply with your network security policy. Keep in mind that the subnet 10.10.100.0/24 represents the previously created VPN DHCP pool and that the “src-address” value of “ether1” represents the MirkoTik’s WAN interface – change this value as needed.

In addition, if VPN clients require internet access through the VPN, the following NAT (masquerade) rule will need to be added.

12. Allow remote DNS request

Select IP > DNS and tick the Allow Remote Requests box shown in the screenshot below.

It would be advisable to create a firewall rule to drop DNS requests from the WAN. I’ve provided the following commands below to accomplish this. These commands can be pasted directly into the MikroTik Terminal. Keep in mind that the “in-interface” value will need to reflect the name of the WAN port on your Mikrotik

ALLOW REMOTE DNS REQUESTSAllow remote DNS request

DNS ENTRIESDNS ENTRIES 1

WINDOWS 10: INSTALL THE “CA” CERTIFICATE

We’ve completed the SSTP VPN setup for SiteX on the Mikrotik and will now need to configure the VPN on the client-side for ClientX’s Windows 10 machine. Earlier in this guide, we exported the “CA” certificate using the MikroTik at SiteX.

CA CERTIFICATECA CERTIFICATE 1CA CERTIFICATE 2

WINDOWS 10: CREATE THE VPN/NETWORK ADAPTER (NON-SPLIT TUNNEL)

We’ve completed the Windows 10 “CA” certificate install for ClientX and now need to create ClientX’s Windows 10 VPN/network adapter. In the Windows 10 Control Panel, open Network and Sharing Center. Select “Set up a new connection or network” and use the following screenshots below to create the VPN/network adapter.

Источник

Manual:Interface/SSTP

Version

Applies to RouterOS: v5, v6+

Contents

Summary

Secure Socket Tunneling Protocol (SSTP) transports a PPP tunnel over a TLS channel. The use of TLS over TCP port 443 allows SSTP to pass through virtually all firewalls and proxy servers.

SSTP connection mechanism

Sstp how works

Note: Starting from v5.0beta2 SSTP does not require certificates to operate and can use any available authentication type. This feature will work only between two MikroTik routers, as it is not in accordance with Microsoft standard. Otherwise to establish secure tunnels mschap authentication and client/server certificates from the same chain should be used. Read more>>

Currently, SSTP clients exist in Windows Vista, Windows 7, Windows 8, Linux and RouterOS.

Note: While connecting to SSTP server, Windows does CRL (certificate revocation list) checking on server certificate which can introduce a significant delay to complete a connection or even prevent the user from accessing the SSTP server at all if Windows is unable to access CRL distribution point! Custom generated CA which does not include CRLs can be used to minimize connection delays and certificate costs (signed certificates with known CA usually are not for free), but this custom CA must be imported into each Windows client individually. It is possible to disable CRL check in Windows registry, but it is supported only by Windows Server 2008 and Windows 7 http://support.microsoft.com/kb/947054

Certificates

Note: Starting from RouterOS v6rc10 SSTP respects CRL

If SSTP clients are Windows PCs then only way to set up a secure SSTP tunnel when using self-signed certificate is by importing the «server» certificate on SSTP server and on the Windows PC adding CA certificate in trusted root.

Note: If your server certificate is issued by a CA which is already known by Windows, then the Windows client will work without any additional certificates.

Warning: RSA Key length must be at least 472 bits if certificate is used by SSTP. Shorter keys are considered as security threats.

Similar configuration on RouterOS client would be to import the CA certificate and enabling verify-server-certificate option. In this scenario Man-in-the-Middle attacks are not possible.

Between two Mikrotik routers it is also possible to set up an insecure tunnel by not using certificates at all. In this case data going through SSTP tunnel is using anonymous DH and Man-in-the-Middle attacks are easily accomplished. This scenario is not compatible with Windows clients.

It is also possible to make a secure SSTP tunnel by adding additional authorization with a client certificate. Configuration requirements are:

This scenario is also not possible with Windows clients, because there is no way to set up client certificate on Windows.

Certificate error messages

When ssl handshake fails, you will see one of the following certificate errors:

Hostname verification

Server certificate verification is enabled on SSTP client, additionally if IP addresses or DNS name found in certificate’s subjectAltName or common-name then issuer CN will be compared to the real servers address. v5.7 adds new parameter verify-server-address-from-certificate to disable/enable hostname verification.

SSTP Client

Sub-menu: /interface sstp-client

Properties

Property Description
add-default-route (yes | no; Default: no) Whether to add SSTP remote address as a default route.
authentication (mschap2 | mschap1 | chap | pap; Default: mschap2, mschap1, chap, pap) Allowed authentication methods.
certificate (string | none; Default: none)
comment (string; Default: ) Descriptive name of an item
connect-to (IP:Port; Default: 0.0.0.0:443) Remote address and port of SSTP server.
default-route-distance (byte [0..255]; Default: 1) sets distance value applied to auto created default route, if add-default-route is also selected
dial-on-demand (yes | no; Default: no) connects to AC only when outbound traffic is generated. If selected, then route with gateway address from 10.112.112.0/24 network will be added while connection is not established.
disabled (yes | no; Default: yes) Whether interface is disabled or not. By default it is disabled.
http-proxy (IP:Port; Default: 0.0.0.0:443) Address and port of HTTP proxy server.
keepalive-timeout (integer | disabled; Default: 60) Sets keepalive timeout in seconds.
max-mru (integer; Default: 1500) Maximum Receive Unit. Max packet size that SSTP interface will be able to receive without packet fragmentation.
max-mtu (integer; Default: 1500) Maximum Transmission Unit. Max packet size that SSTP interface will be able to send without packet fragmentation.
mrru (disabled | integer; Default: disabled) Maximum packet size that can be received on the link. If a packet is bigger than tunnel MTU, it will be split into multiple packets, allowing full size IP or Ethernet packets to be sent over the tunnel. Read more >>
name (string; Default: ) Descriptive name of the interface.
password (string; Default: «») Password used for authentication.
pfs (yes | no; Default: no) Enables «Perfect Forward Secrecy» which will make sure that private encryption key is generated for each session. Must be enabled on both server and client to work.
profile (name; Default: default-encryption) Used PPP profile.
user (string; Default: ) User name used for authentication.
tls-version (any | only-1.2; Default: any) Specifies which TLS versions to allow
verify-server-certificate (yes | no; Default: no) If set to yes, then client checks whether certificate belongs to the same certificate chain as server’s certificate. To make it work CA certificate must be imported.
verify-server-address-from-certificate (yes | no; Default: yes) If set to yes, server’s IP address will be compared to one set in certificate. Read More >>

Quick example

This example demonstrates how to set up SSTP client with username «sstp-test», password «123» and server 10.1.101.1

SSTP Server

Sub-menu: /interface sstp-server

This sub-menu shows interfaces for each connected SSTP client.

An interface is created for each tunnel established to the given server. There are two types of interfaces in SSTP server’s configuration

Dynamic interfaces appear when a user connects and disappear once the user disconnects, so it is impossible to reference the tunnel created for that use in router configuration (for example, in firewall), so if you need a persistent rules for that user, create a static entry for him/her. Otherwise it is safe to use dynamic configuration.

Server configuration

Sub-menu: /interface sstp-server server

Property Description
authentication (pap | chap | mschap1 | mschap2; Default: pap,chap,mschap1,mschap2) Authentication methods that server will accept.
certificate (name | none; Default: none) Name of the certificate that SSTP server will use.
default-profile (name; Default: default)
enabled (yes | no; Default: no) Defines whether SSTP server is enabled or not.
force-aes (yes | no; Default: no) Force AES encryption (AES256 is supported). If enabled windows clients (supports only RC4) will be unable to connect.
keepalive-timeout (integer | disabled; Default: 60) If server during keepalive period does not receive any packet, it will send keepalive packets every second five times. If the server does not receives response from the client, then disconnect after 5 seconds. Logs will show 5x «LCP missed echo reply» messages and then disconnect.
max-mru (integer; Default: 1500) Maximum Receive Unit. Max packet size that SSTP interface will be able to receive without packet fragmentation.
max-mtu (integer; Default: 1500) Maximum Transmission Unit. Max packet size that SSTP interface will be able to send without packet fragmentation.
mrru (disabled | integer; Default: disabled) Maximum packet size that can be received on the link. If a packet is bigger than tunnel MTU, it will be split into multiple packets, allowing full size IP or Ethernet packets to be sent over the tunnel. Read more >>
pfs (yes | no; Default: no) Enables «Perfect Forward Secrecy» which will make sure that private encryption key is generated for each session. Must be enabled on both server and client to work.
port (integer; Default: 443) Port for SSTP service to listen on.
tls-version (any | only-1.2; Default: any) Specifies which TLS versions to allow
verify-client-certificate (yes | no; Default: no) If set to yes, then server checks whether client’s certificate belongs to the same certificate chain.

Warning: It is very important that the date on the router is within the range of the certificate’s date of expiration. To overcome any certificate verification problems, enable NTP date synchronization on both server and client.

Monitoring

Monitor command can be used to monitor status of the tunnel on both client and server.

Property Description
status ( ) Current SSTP status. Value other than «connected» indicates that there are some problems estabising tunnel.
uptime (time) Elapsed time since tunnel was established.
idle-time (time) Elapsed time since last activity on the tunnel.
user (string) Username used to establish the tunnel.
mtu (integer) Negotiated and used MTU
caller-id (IP:ID)

Application Examples

Connecting Remote Client

The following example shows how to connect a computer to a remote office network over secure SSTP encrypted tunnel giving that computer an IP address from the same network as the remote office has (without the need for bridging over EoIP tunnels)

Consider following setup:

Sstp rem office

Office router is connected to internet through ether1. Workstations are connected to ether2. Laptop is connected to the internet and can reach Office router’s public IP (in our example it is 192.168.80.1).

Before you begin to configure SSTP you need to create a server certificate and import it into the router (instructions here).

Now it is time to create a user:

Notice that SSTP local address is the same as the router’s address on the local interface and the remote address is from the same range as the local network (10.1.101.0/24).

Next step is to enable SSTP server and SSTP client on the laptop:

Notice that authentication is set to mschap. These are the only authentication options that are valid to establish a secure tunnel.

SSTP client from the laptop should connect to routers public IP which in our example is 192.168.80.1.

Please, consult the respective manual on how to set up a SSTP client with the software you are using. If you set up SSTP client on Windows and self-signed certificates are used, then CA certificate should be added to trusted root.

Note: Currently, SSTP is only fully supported on recent Windows OS releases such as Vista SP1, Windows 7, Windows 8, Windows 2008 etc. With other OS’s such as Linux, results cannot be guaranteed.

To verify if SSTP client is connected

At this point (when SSTP client is successfully connected) if you try to ping any workstation from the laptop, ping will time out, because Laptop is unable to get ARPs from workstations. Solution is to set up proxy-arp on local interface

After proxy-arp is enabled client can successfully reach all workstations in the local network behind the router.

Site-to-Site SSTP

The following is an example of connecting two Intranets using SSTP tunnel over the Internet.

Consider following setup:

Site to site sstp

Office and Home routers are connected to internet through ether1, workstations and laptops are connected to ether2. In this example both local networks are routed through SSTP client, thus they are not in the same broadcast domain. To overcome this problem as with any other ppp tunnel, SSTP also supports BCP which allows it to bridge SSTP tunnel with a local interface.

First step is to create a user:

Notice that we set up SSTP to add a route whenever the client connects. If this option is not set, then you will need a static routing configuration on the server to route traffic between sites through the SSTP tunnel.

Now we need to upload and import CA and server/client certificates. Assuming that the files are already uploaded use following commands:

Edit names to something more meaningful:

Do the same on client side, but instead of server’s certificate import client’s certificate.

Next step is to enable SSTP server on the office router:

Now configure SSTP client on the Home router:

Now we need to add static route on Home router to reach local network behind Office router:

After tunnel is established you should be able to ping remote network.

Источник

SSTP (Secure Socket Tunneling Protocol – протокол безопасного туннелирования сокетов) – VPN протокол, основанный на SSL 3.0. Благодаря этому данные шифруются. Аутентификация осуществляется с помощью PPP. Соединение проходит с помощью HTTPS по 443 порту (настраиваемо).

SSTP это разработка компании Miсrosoft, как некий аналог прогрессивным протоколам, которые используют шифрование. Самый прямой аналог в мире VPN служб это OpenVPN, в основе которого лежит:

  • использование сертификатов SSL;
  • низкие требования к аппаратной части(железу);
  • высокая производительность, которая прямо отражается на скорости соединения.

Содержание

  • Создание SSL сертификата для SSTP VPN сервера;
  • Настройка SSTP VPN сервера;
  • Экспорт сертификата для VPN клиентов;
  • Создание VPN туннеля типа роутер MikroTik → Windows клиент;
  • Создание VPN туннеля типа роутер MikroTik-1 → роутер MikroTik-2.

Настройка SSTP VPN сервера на роутере MikroTik

В рамках статьи будут рассмотрены две самые популярные связки: соединение типа роутер-клиент и роутер-роутер:

SSTP туннель между MikroTik и Windows

  • SSTP VPN сервер на роутере MikroTik;
  • SSTP VPN клиент на Windows 10.

Настройка SSTP в MikroTik, туннель между роутером и Windows

SSTP туннель между MikroTik и MikroTik

  • SSTP VPN сервер на роутере MikroTik-1;
  • SSTP VPN клиент на роутере MikroTik-2.

Настройка SSTP в MikroTik, туннель между двумя роутерами

Создание SSL сертификата в MikroTik для работы SSTP VPN сервера

Эта общая настройка, на которую будут ссылаться две последующие конфигурации для Windows клиента, а также для SSTP клиента на второго роутера MikroTik.

Создание сертификата для центра сертификации(CA)

Настройка находится System→Certificates

Настройка SSTP в MikroTik, создание сертификата для центра сертификации(CA)

Указать возможность подписи данным сертификатом других сертификатов

Настройка SSTP в MikroTik, указать возможность подписи данным сертификатом других сертификатов

Подпись CA сертификата

Настройка SSTP в MikroTik, подпись CA сертификата

Результат подписи сертификата и процесс

Настройка SSTP в MikroTik, результат подписи сертификата и процесс

Создание сертификата SSL для SSTP VPN сервера

Настройка SSTP в MikroTik, создание сертификата SSL для SSTP VPN сервера

Указать возможность использовать этот сертификат в качестве клиентского и серверного сертификата

Настройка SSTP в MikroTik, указать возможность использовать этот сертификат в качестве клиентского и серверного сертификата

Подпись сертификата для SSTP центром сертификации(CA)

Настройка SSTP в MikroTik, подпись сертификата для SSTP центром сертификации(CA)

Сертификаты для работы SSTP VPN сервера в MikroTik

Настройка SSTP в MikroTik, сертификаты для работы SSTP VPN сервера в MikroTik

Настройка SSPT VPN сервера в MikroTik

Создание IP пула для VPN клиентов SSTP

Настройка находится IP→Pool

Настройка SSTP в MikroTik, создание IP пула для VPN клиентов SSTP

/ip pool
add name=Ip-Pool-Vpn ranges=192.168.50.100-192.168.50.254

Добавление VPN профиля

Настройка находится PPP→Profiles

Настройка SSTP в MikroTik, добавление VPN профиля

/ppp profile
add local-address=192.168.50.1 name=VPN-Profile remote-address=Ip-Pool-Vpn

Добавление учетной записи для VPN клиента SSTP

Настройка находится PPP→Secrets

Настройка SSTP в MikroTik, добавление учетной записи для VPN клиента SSTP

/ppp secret
add name=user-sstp password=Av3D2eyAF87f profile=VPN-Profile service=sstp

Активация SSTP VPN сервера

Настройка находится PPP→Interface→SSTP Server

Настройка SSTP в MikroTik, активация SSTP VPN сервера

/interface sstp-server server
set authentication=mschap2 certificate=92490a0ea575.sn.mynetname.net 
default-profile=VPN-Profile force-aes=yes

Экспорт SSL сертификата для удаленных SSTP VPN клиентов

Экспорт сертификата CA

Настройка находится System→Certificates

Настройка SSTP в MikroTik, экспорт сертификата для VPN клиента

Указать тип сертификата и ключ

Настройка SSTP в MikroTik, указать тип ключа

Выгрузка сертификата для VPN клиентов

Настройка находится Files→File List→Download

Настройка SSTP в MikroTik, выгрузка сертификата для VPN клиента

Пример выгруженного сертификата

Настройка SSTP в MikroTik, пример выгруженного сертификата SSL

VPN туннель SSTP между роутером MikroTik и Windows клиентом

Сформированный сертификат SSL на роутере MikroTik необходимо установить на каждом VPN клиенте.

Установка сертификата на локальный компьютер

Настройка SSTP в MikroTik, установка сертификата на локальный компьютер

Выбор хранилища для сертификата

Настройка SSTP в MikroTik, выбор хранилища для сертификата

Успешный импорт сертификата

Настройка SSTP в MikroTik, успешный импорт сертификата

Создание нового VPN туннеля типа SSTP

Настройка SSTP в MikroTik, создание нового VPN туннеля типа SSTP

Указать адрес и имя VPN соединения

Настройка SSTP в MikroTik, указать адрес и имя VPN соединения

Указать параметры шифрования

Настройка SSTP в MikroTik, указать параметры шифрования

Подключить VPN

Настройка SSTP в MikroTik, подключить VPN

Ввести имя пользователя и пароль

Настройка SSTP в MikroTik, ввести имя пользователя и пароль

Пример успешного VPN соединения

Настройка SSTP в MikroTik, пример успешного VPN соединения

VPN туннель SSTP между двумя роутерами MikroTik

Загрузка сертификата SSL в MikroTik

Настройка находится Files→File List→Upload

Настройка SSTP в MikroTik, загрузка сертификата в MikroTik

Импорт сертификата

Настройка находится System→Certificates

Настройка SSTP в MikroTik, импорт сертификата SSL

Пример импортированного сертификата для SSTP VPN клиента

Создание SSTP VPN клиента

Настройка находится PPP→Interface

Настройка SSTP в MikroTik, создание VPN клиента

Настройка SSTP VPN клиента

Настройка SSTP в MikroTik, настройка SSTP VPN клиента на роутере

/interface sstp-client
add authentication=mschap2 certificate=
cert_export_92490a0ea575.sn.mynetname.net.p12_0 connect-to=
92490a0ea575.sn.mynetname.net disabled=no name=sstp-out1 password=
Av3D2eyAF87f profile=default-encryption user=user-sstp

Статус подключения и характеристики VPN клиента

Настройка SSTP в MikroTik, статус подключения и характеристики VPN клиента 

Есть вопросы или предложения по настройке VPN типа SSTP в MikroTik? Активно предлагай свой вариант настройки! Оставить комментарий

VPN (Virtual Private Network) technology provides a secure and encrypted tunnel across a public network. So, a private network user can send and receive data to any remote private network through VPN tunnel as if his/her network device was directly connected to that private network.

Secure Socket Tunneling Protocol (SSTP) transports PPP tunnel over TLS channel. SSTP uses TLS channel over TCP port 443. So, SSTP VPN can virtually pass through all firewalls and proxy servers. Because of using TLS channel, encrypted data passes over SSTP Tunnel. So, there is no chance to steal data by a middle man attacker and data can send and receive across public network safely. MikroTik SSTP Server can be applied in two methods.

  • Connecting from remote workstation/client: In this method, SSTP VPN client software can communicate with MikroTik SSTP VPN Server over Secure VPN tunnel whenever required and can access remote private network as if it was directly connected to that remote private network.
  • Site to Site SSTP VPN: This method is also known as VPN between routers. In this method, an SSTP client supported router always establishes a SSTP VPN tunnel with MikroTik SSTP VPN Server. So, private networks of these two routers can communicate with each other as if they were directly connected to the same router.

The goal of this article is to connect a remote client device over secure SSTP VPN Tunnel across public network. So, in this article I will only show how to configure MikroTik SSTP VPN Server for connecting a remote workstation/client (Windows 10 Client).

How SSTP Connection Established

To establish a SSTP VPN tunnel across public network, the following mechanisms are occurred.

SSTP How Works
SSTP How Works
  • TCP connection is established from SSTP Client to SSTP Server on TCP port 443.
  • SSL validates server certificate. If certificate is valid connection is established otherwise connection is denied.
  • The client sends SSTP control packets within the HTTPS session which establishes the SSTP state machine on both sides.
  • PPP username and password validation is checked over SSTP. Client authenticates to the server and binds IP addresses to SSTP Client interface.
  • SSTP tunnel is now established and packet encapsulation can begin.

Network Diagram

To configure a Client-Server SSTP VPN Tunnel between a MikroTik Router and a Windows 10 SSTP Client, we are following the below network diagram.

Client-Server SSTP Diagram
Client-Server SSTP Diagram

In this network diagram, a MikroTik Router’s ether1 interface is connected to public network having IP address 117.58.247.198/30 and ether2 interface is connected to LAN having IP network 10.10.11.0/24.

We will configure SSTP Server in this MikroTik Router on TCP port 443. So, Windows 10 SSTP Client can be connected to this SSTP Server and can be able to access remote network resources as if the device is connected to that remote network.

SSTP VPN Server and SSTP Client Configuration

We will now start SSTP Server and Client configuration. Complete SSTP configuration can be divided into two parts.

  • Part 1: SSTP Server Configuration in MikroTik Router
  • Part 2: SSTP Client Configuration in Windows 10

Part 1: SSTP Server Configuration in MikroTik Router

According to the network diagram, MikroTik Router is our SSTP VPN Server. So, we will enable and configure SSTP VPN Server in MikroTik Router. It is assumed that MikroTik WAN and LAN networks have been configured and are working without any issue.

Complete MikroTik SSTP Server configuration can be divided into the following three steps.

  • Step 1: Creating TLS Certificate for SSTP Server
  • Step 2: Enabling and Configuring SSTP Server
  • Step 3: Creating SSTP Users

Step 1: Creating TLS Certificate for SSTP Server

SSTP Server configuration requires TLS certificate because SSTP VPN uses TLS certificate for secure communication. MikroTik RouterOS v6 gives ability to create, store and manage certificates in certificate store. So, we will create required SSTP Server certificate from MikroTik RouterOS. SSTP Server requires two types of certificates:

  • CA (Certification Authority) Certificate and
  • Server Certificate

Creating CA certificate

MikroTik RouterOS provides a self-signed certificate and self-signed certificate must have a CA (Certification Authority) Certificate to sign Server Certificate. This CA certificate will also be installed in SSTP Client devices otherwise Server Certificate cannot be verified.  The following steps will show how to create a CA certificate in MikroTik RouterOS.

  • From Winbox, go to System > Certificates menu item and click on Certificates tab and then click on PLUS SIGN (+). New Certificate window will appear.
  • Put your CA certificate name (for example: CA) in Name input field.
  • Put the WAN IP Address (example: 117.58.247.198) of MikroTik Router in Common Name input field.
  • You will find some optional fields in General tab. You can fill those if you wish. All fields are self-defined.
  • Click on Key Usage tab and uncheck all checkboxes except crl sign and key cert. sign
  • Click on Apply button and then click on Sign button. Sign window will appear now.
  • Your created CA certificate template will appear in Certificate dropdown menu. Select your newly created certificate template if it is not selected.
  • Put MikroTik Router’s WAN IP address (example: 117.58.247.198) in CA CRL Host input field.
  • Click on Sign button. Your Signed certificate will be created within few seconds.
  • Click on OK button to close New Certificate window.
  • If newly created CA certificate does not show T flag or Trusted property shows no, double click on your CA certificate and click on Trusted checkbox located at the bottom of General tab and then click on Apply and OK button.
Creating CA Certificate for SSTP Server
Creating CA Certificate for SSTP Server

Creating Server Certificate

After creating CA certificate, we will now create Server Certificate that will be signed by the created CA. The Server Certificate will be used by SSTP Server. The following steps will show how to create Server Certificate in MikroTik RouterOS.

  • Click on PPP menu item from Winbox and then click on Interface tab.
  • Click on SSTP Server button. SSTP Server window will appear.
  • Click on Enabled checkbox to enable SSTP Server.
  • Make sure TCP Port 443 is assigned in Port input field.
  • From Authentication, uncheck all checkboxes except mschap2 checkbox.
  • From Certificate dropdown menu, choose server certificate (Server) that we created before.
  • From TLS Version drop down menu, choose only-1.2 option. TLS Version any can also be selected.
  • Now click on Force AES and PFS checkboxes.
  • Now click on Apply and OK button.
Enabling SSTP Server in MikroTik Router
Enabling SSTP Server in MikroTik Router

SSTP Server is now running in MikroTik Router. As MikroTik SSTP VPN is limited to use username and password for successful VPN connection, we will now create PPP users who will be able to connect to MikroTik SSTP Server and get IP information.

Step 3: Creating SSTP Users

MikroTik SSTP uses username and password to validate legal connection. So, we have to create username and password to allow any user. The complete user configuration for SSTP Server can be divided into the following three parts.

  • IP Pool Configuration
  • User Profile Configuration and
  • SSTP User Configuration

IP Pool Configuration

Usually multiple users can connect to SSTP Server. So, it is always better to create an IP Pool from where connected user will get IP address. The following steps will show how to create IP Pool in MikroTik Router.

  • From Winbox, go to IP > Pool menu item. IP Pool Window will appear.
  • Click on PLUS SIGN (+). New IP Pool window will appear.
  • Put a meaningful name (vpn_pool) in Name input field.
  • Put desired IP Ranges (example: 192.168.2.2-192.168.2.254) in Addresses input filed. Make sure not to use VPN Gateway IP (192.168.2.1)in this range.
  • Click Apply and OK button.
SSTP User IP Pool
SSTP User IP Pool

User Profile Configuration

After creating IP Pool, we will now configure user profile so that all users can have similar characteristics. The following steps will show how to configure user profile for SSTP Users.

  • From Winbox, go to PPP menu item and click on Profile tab and then click on PLUS SIGN (+). New PPP Profile window will appear.
  • Put a meaningful name (example: vpn_profile) in Name input field.
  • Put VPN Gateway address (example: 192.168.2.1) in Local Address input field.
  • Choose the created IP Pool (vpn_pool) from Remote Address dropdown menu.
  • Click Apply and OK button.
OpenVPN User Profile Configuration
OpenVPN User Profile Configuration

SSTP User Configuration

After creating user profile, we will now create users who will be connected to SSTP Server. The following steps will show how to create SSTP users in MikroTik RouterOS.

  • From PPP window, click on Secrets tab and then click on PLUS SIGN (+). New PPP Secret window will appear.
  • Put username (For example: sayeed) in Name input field and put password in Password input field.
  • Choose sstp from Service dropdown menu.
  • Choose the created profile from Profile dropdown menu.
  • Click on Apply and OK button.
SSTP User Configuration
SSTP User Configuration

We have created a user for SSTP Server. Similarly, we can create more users that we require.

SSTP Server configuration in MikroTik Router has been completed. In the next part we will configure SSTP Client in Windows 10 Operating System.

Part 2: SSTP Client Configuration in Windows 10

After configuring SSTP Server in MikroTik Router, we will now configure SSTP Client in Windows 10 Operating System. SSTP Client configuration in Windows 10 can be divided into the following two steps.

  • Installing CA Certificate in Windows 10
  • SSTP Client Configuration in Windows 10

Installing CA Certificate in Windows 10

Exported CA Certificate must be installed in Windows Trusted Root Certification Authorities otherwise SSTP Client cannot verify SSTP Server Certificate. To install CA Certificate in Windows 10, do the following steps.

Click mouse right button on the Exported CA Certificate and choose Install Certificate option.

CA Certificate Installation in Windows 10
CA Certificate Installation in Windows 10

You will now find Certificate Import Wizard window and it will ask for choosing certificate Store Location. From Sore Location panel, choose Local Machine radio button and then click Next button.

Certificate Import Wizard
Certificate Import Wizard

The next window will ask for choosing a specific certificate store. Exported CA must be placed in Trusted Root Certification Authorities store. So, click on Place all certificate in the following store radio button and then click on Browse button and choose Trusted Root Certificate Authorities and then click Next button.

Placing CA Certificate to Trusted Root Certification Authorities
Placing CA Certificate to Trusted Root Certification Authorities

The next Certificate Import Wizard will show a summery and ask to click Finish button. So, click Finish button and you will find a certificate importation successful message.

SSTP Client Configuration in Windows 10

After importing CA certificate in Trusted Root Certification Authorities, we will now configure SSTP Client in Windows 10 Operating System. The Following steps will show how to configure SSTP Client in Windows 10 OS.

How to Configure MikroTik SSTP VPN Server with Windows 10 Operating System has been discussed in this article. I hope you will now be able to configure SSTP Server and Client with MikroTik Router and Windows 10 Operating System. However, if you face any confusion to configure SSTP VPN Server and Client, feel free to discuss in comment or contact me from Contact page.  I will try my best to stay with you.

Introduction

SSTP VPN is a proprietary VPN technology made by Microsoft which has been around for quite some years (for over a decade in fact). It tunnels PPP over a HTTPS connection which in turn is secured by TLS. With SSTP using standard HTTPS and TLS protocols, Microsoft tried to overcome the issues with traditional PPTP or L2TP over IPSEC VPN tunnels, which often are blocked by various internet access gateways used by the end-users (e.g. in a hotel).

Currently I am not aware of any SSTP server implementations other than Routing and RAS services (which are included in Microsoft Windows Server) since Windows Server 2012 and the one from RouterOS in MikroTik routers. As not everyone can or wants to utilize a Windows Server for this task, I decided to take a look at MikroTiks approach.

At the beginning of this journey, one limitation of RouterOS was not immediately obvious to me: Authentication via EAP-TLS is not possible, so we will have to work around that by using MSCHAPv2 instead. MikroTiks answer to my question why it is not implemented and as of writing this post there are no plans of implementing it was, that SSTP is quite slow (aka resource intensive) already and that all the traffic is being secured by TLS anyway, so I guess they said “bugger that” and sticked with MSCHAPv2.

The goal

At the end of this post we want to have a MikroTik hEX router serving an SSTP VPN server for a Windows 10 client to do Windows Always On VPN. For this time, we will deploy a so called “User Tunnel” instead of a “Device Tunnel”. The difference is, that a User Tunnel comes up automatically only after the correct user has logged on to the client system. A device tunnel on the other hand is meant to be up and running as soon as a computer has completed booting the operating system, before any user logs in.

Given the state my current lab environment which already has a Internet-facing firewall (Fortigate 60D in this case) plus the fact that a MikroTik hEX router does not have too much power when it comes to excessive firewalling, I have decided to put the MikroTik router into DMZ networks of my firewall. This design allows me to do all the firewalling on my Fortigate and let the hEX focus on doing SSTP server stuff. Any traffic that enters or leaves the hEX router, has to go through the Fortigate, where I can create more firewall rules than I will ever need and which also has the processing power for that.

Topology overview

Note that the hEX from one of my previous posts (Clicky) is still there, we have two hEX routers in this network now! In an upcoming post I’ll explain how to do this with one single hEX router while keeping the Topology from above so we can still use our Fortigate firewall for firewalling. Hint: It will involve VRF!

For now, all VPN traffic is going to flow from the client laptop on the right, through the SSTP VPN connection to the Fortigate firewall which forwards this traffic via NAT to the 10.2.2.2 IP of our hEX SSTP server, where the tunnel terminates. From there, all traffic is being routed through the LAN side of the hEX SSTP server (10.2.1.2) to the firewall (10.2.1.1) where it will be routed further to the internal MikroTik hEX router (10.1.0.2) where the traffic will finally reach its destination.

Start by deploying a TLS certificate

For SSTP to work properly and securely, your hEX SSTP server needs a TLS certificate which is being trusted by the MikroTik router and all your potential SSTP client computers. If you want to know how to accomplish that, have a look at my previous blog post about that topic: Clicky

A standard Web Server certificate will do, make sure that you are using at least SHA256 hashing algorithm and at least a 2048 bit key. Supposedly a ECDSA_P256 certificate is even more secure and recommended for SSTP, but I’m not sure whether MikroTiks support that, so let’s stick to a RSA-2048/SHA256 certificate for now.

Name the certificate something like “SSTP-Server” and import it into your MikroTik router. Make sure, as always, that your trust chain is complete and that your CRL infrastructure works from the Internet (because clients are going to check the CRL during SSTP connection establishment).

RADIUS

Because we want proper Always On VPN without users having to enter credentials and to make use of our existing identity provider (probably Active Directory or some other LDAP server), we want to use an existing RADIUS server which authenticates against our identity provider. In this scenario I’m using Microsoft Windows NPS server (which comes included with Windows Server) but of course you can use whatever you want. Preferably configure a LDAP user group or something with all the users who are allowed to connect via SSTP VPN and then configure your RADIUS server accordingly, so that it allows connection requests from users who are a member of that group. For Windows NPS server I can tell you that you will also have to enable the MSCHAPv2 authentication method in the according network policy.

Configure the RADIUS client of your MikroTik router like this:

/radius add address=10.0.1.100 authentication-port=1812 accounting-port=1813 protocol=udp secret=myverysecretSecret service=ppp src-address=10.2.1.2

Choose a proper secret key and note that I have set the src-address to the LAN facing side of our SSTP router. Our firewall is only going to allow traffic from 10.2.1.2 to the NPS server 10.0.1.100, which lives all the way on the left in our VLAN 1001.

Now enable RADIUS so our hEX actually starts utilizing it for authentication requests:

/ppp aaa set use-radius=yes

Hint: If you are using Windows NPS server as RADIUS, you will have to enable NTLMv2 compatibility, if you were following general security recommendations in the past and have already disabled NTLM in your network. To do that, create a DWORD item with the name “Enable NTLMv2 Compatibility Value” and value 1 in the following path:

HKEY_LOCAL_MACHINESystemCurrentControlSetServicesRemoteAccessPolicy

IP Pool and PPP profile

Now let’s create an IP pool for our SSTP clients. That pool is going to matter to our firewall, because we will be using these IP addresses to create our ruleset and to define where the SSTP VPN clients will be allowed talking to. Other than that, it doesn’t really matter which IP range you choose, just be aware that you must not overlap it with any IP subnets which are already in use in your network. In my case, I have chosen the SSTP client network to be 10.20.25.0/24 while leaving some spare addresses from .101 to .254 and leaving .1 for the router itself:

/ip pool add name=SSTP-VPN-Pool ranges=10.20.25.2-10.20.25.100

Now let’s create a PPP profile. At first I was confused why I had to create a PPP profile for SSTP but when I realized that SSTP really just tunnels PPP, it was quite obvious:

/ppp profile
add dns-server=10.0.1.101,10.0.2.101 local-address=10.20.25.1 name=SSTP-VPN-Profile only-one=yes remote-address=SSTP-VPN-Pool use-compression=yes use-encryption=required

  • The dns-server property defines which DNS servers are going to be propagated to our SSTP clients, so enter your internal DNS servers here for proper name resolution to work. Don’t forget to create a firewall rule for that DNS traffic!
  • local-address” just defines the router’s own IP address which the SSTP clients will be talking to. Note, that I have deliberately excluded that IP from the client IP pool so we don’t get any overlaps.
  • The parameter “only-one” makes your client users Highlanders. It allows only one connection per user account. Depending on your environment, choose what suits your requirements best.
  • remote-address” defines the IP pool which will be used for your clients connections
  • use-compression” and “use-encryption” I am not quite sure about. According to MikroTik documentation, use-encryption has no effect on SSTP tunnels, it still gives me the warm, fuzzy feeling though, to have it enabled. “use-compression” may or may not have an effect, I hadn’t had the chance to verify/benchmark that yet. Enabled compression may negatively affect your hEX’s CPU load, though.

Enable the SSTP server

Finally, we can enable our SSTP server on the hEX router:

/interface sstp-server server
set authentication=mschap2 certificate=SSTP-Server default-profile=SSTP-VPN-Profile enabled=yes force-aes=yes pfs=yes port=443 tls-version=only-1.2

  • authentication” allows us to choose between pap, chap, mschap1 and mschap2 of which we want to use the most secure one (or rather the least insecure one), which is mschap2
  • “certificate” obviously sets the certificate we have created and imported earlier for the SSTP server – see here for a how to: Clicky
  • “default-profile” configures the SSTP server to use our previously created SSTP profile
  • Regarding “force-aes”, the MikroTik documentation states that Windows clients won’t be able to connect if enabled, because they only support RC4. I haven’t verified since when Windows clients support more than that, but Windows 10 20H2 is perfectly able to connect with force-aes enabled and I’ll take a wild guess and say that that’s like that for quite some years now and that MikroTiks documentation simply hasn’t been updated here.
  • “pfs” is another security measure you want to have enabled if possible, I’m however not sure whether Windows supports that. In my lab, the connection comes up flawlessly, however.
  • With “tls-version=only-1.2” we add another bit of security by disabling weak and insecure, old TLS and SSL standards like SSL 3.0, TLS 1.0 and TLS 1.1

Create routes for your traffic

To enable your SSTP client users to reach all required network destinations, you will need some routes:

/ip route
add distance=1 gateway=10.2.2.1 pref-src=10.2.2.2
add distance=1 dst-address=10.0.1.0/24 gateway=10.2.1.1 pref-src=10.2.1.2
add distance=1 dst-address=10.0.2.0/24 gateway=10.2.1.1 pref-src=10.2.1.2
add distance=1 dst-address=10.0.3.0/24 gateway=10.2.1.1 pref-src=10.2.1.2

The first route is our default route into the Internet, it goes through the WAN side of our hEX router (10.2.2.2). The following three routes are there for traffic to the LAN VLANs 1001-1003 to go through the LAN side of our router (10.2.1.2) to our firewall where you can define firewall rules who will be allowed to access what resources.

A little bit of firewalling on the hEX router

I would advice to block traffic from the SSTP clients to the management interfaces of your hEX router. To do that, create the following rule:

/ip firewall filter
add action=drop chain=input in-interface=all-ppp src-address=10.20.25.0/24

Create Windows Client VPN profile

Next we need to create a VPN profile for Windows. There are several ways to do this, including Microsoft Intune or Microsoft System Center Configuration Manager (or Endpoint Manager as it is called nowadays). We are going to use a Powershell script here and the following XML file named “vpn.xml”:

<VPNProfile>
	<NativeProfile>
		<Servers>sstp.mydomain.com</Servers>
		<NativeProtocolType>Automatic</NativeProtocolType>
		<Authentication>
			<UserMethod>MSChapv2</UserMethod>
		</Authentication>
		<RoutingPolicyType>SplitTunnel</RoutingPolicyType>
		<DisableClassBasedDefaultRoute>true</DisableClassBasedDefaultRoute>
	</NativeProfile>
	<Route>
		<Address>10.0.1.0</Address>
		<PrefixSize>24</PrefixSize>
	</Route>
	<Route>
		<Address>10.0.2.0</Address>
		<PrefixSize>24</PrefixSize>
	</Route>
	<Route>
		<Address>10.0.3.0</Address>
		<PrefixSize>24</PrefixSize>
	</Route>
	<AlwaysOn>true</AlwaysOn>
	<TrustedNetworkDetection>myLocalDomain.lan</TrustedNetworkDetection>
	<DeviceTunnel>false</DeviceTunnel>
	<RegisterDNS>true</RegisterDNS>
</VPNProfile>
  • Servers sstp.mydomain.com resolves to the public IP of our firewall (2.4.5.6), where traffic gets NATed to the internet-facing IP of our MikroTik hEX SSTP server (10.2.2.2).
  • NativeProtocolType sets the tunnel type. Possible values are PPTP, L2TP, IKEv2 and Automatic, according to Microsoft documentation. Choosing Automatic will try protocolls in following order: SSTP, IKEv2, PPTP and L2TP. Again, this is according to current Microsoft documentation.
  • Authentication/UserMethod can be EAP or MSChapv2 but as MikroTik does not support EAP, we have to stick with MSChapv2
  • RoutingPolicyType set to SplitTunnel means that only defined IP ranges which are defined later in the XML file are being routed into the VPN tunnel. ForceTunnel would mean that any traffic must go over the VPN tunnel. Choose what suits your needs, i prefer split tunneling.
  • DisableClassBasedDefaultRoute seems like a typical Microsoft configuration option to me. If set to yes, and the client interface IP begins with 10 (for example), a route with destination 10.0.0.0/8 will be configured for the tunnel. I prefer creating specific routes manually.
  • With entries like the Route ones, you can define IP subnets or hosts (when using the /32 prefix size) which should be routed over the VPN tunnel. In our example I have added the IP ranges of our internal VLANs 1001-1003.
  • AlwaysOn means what it says. The tunnel auto-connects upon sign in of the user until the user manually disconnects it.
  • TrustedNetworkDetection is a feature to prevent client computers from connecting to the VPN when they already are inside the corporate network. This checks the DNS suffix of the LAN connections of your client computer and if it finds the one specified in this setting, the VPN tunnel is prevented from connecting automatically.
  • DeviceTunnel set to false means that this is a UserTunnel. For an explanation about the differences see the introduction at the beginning of this post.
  • RegisterDNS set to true tries to register the client computers IP address of the VPN tunnel interface with the DNS servers we have supplied in the PPP profile of our MikroTik. Very handy, if you want to have all your client computers resolvable while they are on the go!

Hint: I have seen TrustedNetworkDetection sometimes to not work properly which can cause issues and unwanted behavior. To prevent clients from connecting to your SSTP server while they are within your corporate network, you can for example block access to the SSTP server from your LAN or incorporate DNS policies on your internal DNS servers which disallow internal clients to resolve your SSTP server hostname (sstp.mydomain.com) properly.

Hint 2: Further documentation on VPN profile configuration and many of the options can be found at docs.microsoft.com.

Deploy profile

Profiles can be deployed using several methods. As mentioned before we are going to do it with a Powershell script:

$xmlFilePath = "vpn.xml"
$ProfileName = "USER-TUNNEL"

$ProfileXML = Get-Content $xmlFilePath
$ProfileNameEscaped = $ProfileName -replace ' ', '%20'
$ProfileXML = $ProfileXML -replace '<', '&lt;'
$ProfileXML = $ProfileXML -replace '>', '&gt;'
$ProfileXML = $ProfileXML -replace '"', '&quot;'

$nodeCSPURI = './Vendor/MSFT/VPNv2'
$namespaceName = "rootcimv2mdmdmmap"
$className = "MDM_VPNv2_01"

$session = New-CimSession

try
{
    $newInstance = New-Object Microsoft.Management.Infrastructure.CimInstance $className, $namespaceName
    $property = [Microsoft.Management.Infrastructure.CimProperty]::Create("ParentID", "$nodeCSPURI", 'String', 'Key')
    $newInstance.CimInstanceProperties.Add($property)
    $property = [Microsoft.Management.Infrastructure.CimProperty]::Create("InstanceID", "$ProfileNameEscaped", 'String', 'Key')
    $newInstance.CimInstanceProperties.Add($property)
    $property = [Microsoft.Management.Infrastructure.CimProperty]::Create("ProfileXML", "$ProfileXML", 'String', 'Property')
    $newInstance.CimInstanceProperties.Add($property)

    $session.CreateInstance($namespaceName, $newInstance)
    $Message = "Created $ProfileName profile."
    Write-Host "$Message"
}
catch [Exception]
{
    $Message = "Unable to create $ProfileName profile: $_"
    Write-Host "$Message"
    exit
}

$Message = "Complete."
Write-Host "$Message"

Only thing you need to do is to replace “vpn.xml” with the path and filename to your xml file, replace “USER-TUNNEL” with your desired VPN tunnel name and run the script.

Conclusion

We now have a MikroTik hEX router running an SSTP server for our Windows Always On clients and a template for configuring as many Windows clients as we want for Always On VPN. This can be an affordable and easy solution instead of having to license yet another Windows Server for this task. Also, we can use our favourite firewall (nobody says it has to be a Fortigate like in my case) and leverage its capabilities to let the hEX do what it can do best: routing (and SSTP-servering ;-))

Upcoming

As some of you may have only one public IP address available and SSTP now uses our valuable port 443, I’m planning to write a blog post about how to publish your hEX routers SSTP server through a HTTPS reverse proxy which allows you to use your single public IP for multiple services, all on port 443. Hint: they will be distinguished by their host name!

Also, some of you may only have one hEX router and (for incomprehensible reasons) want to keep it that way. For those of you I will write a blog post about how to isolate the SSTP server part and the internal core router part from each other using VRF.

BUY ME A COFFEE (AKA Make a one-time donation)

Your contribution is appreciated. Coffee will eventually turn into more hopefully useful posts.

Donate


Make a monthly donation

Your contribution is appreciated.

Donate monthly


Make a yearly donation

Your contribution is appreciated.

Donate yearly

mikrotik-sstp-vpn-server-000.pngПродолжая тему VPN для удаленного доступа, сегодня мы хотим рассмотреть настройку SSTP-сервера на базе оборудования Mikrotik. Это не самый распространенный и популярный протокол, но имеющий ряд особенностей и преимуществ, главное из которых — использование стандартного протокола HTTPS для установления соединения, что делает SSTP-трафик неотличимым от обычного и дает возможность работать из любой точки, где есть интернет, проходя через NAT, брандмауэры и даже прокси-сервера. При этом его достаточно просто настроить и использовать, о чем мы расскажем в данной статье.

Научиться настраивать MikroTik с нуля или систематизировать уже имеющиеся знания можно на углубленном курсе по администрированию MikroTik. Автор курса, сертифицированный тренер MikroTik Дмитрий Скоромнов, лично проверяет лабораторные работы и контролирует прогресс каждого своего студента. В три раза больше информации, чем в вендорской программе MTCNA, более 20 часов практики и доступ навсегда.

Практически все из рассмотренных нами ранее протоколов VPN имеют те или иные ограничения, которые могут помешать установить соединение в условиях ограниченного доступа к сети интернет. Особенно это актуально для публичных и гостиничных сетей, где может быть заблокировано практически все, кроме обычного HTTP/HTTPS. Именно в таких сценариях раскрываются сильные стороны протокола SSTP и отходят на второй план слабые. Как мы уже говорили раньше — нет универсального VPN-решения, каждое из них имеет свои особенности и недостатки, поэтому для каждой задачи надо выбирать именно то, что поможет решить ее наилучшим образом.

SSTP, как технологию удаленного доступа следует рассматривать в первую очередь для тех клиентов, которые могут работать из самых различных мест и должны всегда иметь возможность быстро подключиться к корпоративной сети соблюдая высокие требования безопасности. К недостаткам следует отнести повышенные накладные расходы и связанную с этим невысокую производительность, но это общий недостаток всех VPN-протоколов поверх TCP.

В случае использования оборудования Mikrotik встает вопрос высокой нагрузки на процессор для моделей без аппаратной поддержки AES. При этом вне зависимости от аппаратной поддержки шифрования скорость канала для недорогих моделей вряд-ли превысит 20-25 МБит/с , вне зависимости от доступной ширины канала. Более подробно об этом можете прочитать в нашей статье Производительность младших моделей Mikrotik hEX и hAP. Экспресс-тестирование. Поэтому мы не советуем использовать SSTP для каналов, предполагающих высокую загрузку, но можем рекомендовать как надежное и безопасное средство удаленного доступа для сотрудников, часто работающих вне стационарных рабочих мест.

Создание центра сертификации и выпуск сертификатов

Так как SSTP использует HTTPS для установления защищенного соединения нам понадобится сертификат сервера, поэтому создадим собственный центр сертификации (CA) и выпустим необходимый сертификат. Если в вашей сети уже имеется развернутая инфраструктура PKI, то можете выпустить сертификат с ее помощью, мы же рассмотрим использование для этих целей собственных возможностей RouterOS.

Перед тем, как приступить к созданию центра сертификации убедитесь, что на роутере правильно настроено текущее время и часовой пояс, а также включена синхронизация времени через NTP.

Сначала выпустим корневой сертификат, для этого перейдем в System — Certificate и создадим новый сертификат заполнив поля как указано на рисунке, красным обозначены обязательные к заполнению.

mikrotik-sstp-vpn-server-001.pngName — видимое имя сертификата, Common Name — имя субъекта, которому выдан сертификат, в каждом из них указываем CA (т.е. Certification authority). Вообще там можно написать все что угодно, но правила хорошего тона требуют давать сертификатам понятные имена. Key Size — размер ключа, оставляем по умолчанию 2048, Days Valid — срок действия сертификата в днях, имеет смысл указать достаточно продолжительный срок, в нашем случае 10 лет.

Перейдем на вкладку Key Usage и оставим только crl sign и key cert. sign, затем сохраним сертификат нажав Apply, и подпишем его кнопкой Sign, в открывшемся окне следует указать CA CRL Host, для которого можно использовать один из IP-адресов роутера, в нашем случае это localhost. Если же при помощи данного CA вы собираетесь выпускать сертификаты для других серверов, то следует указать доступный для них адрес, внутренний или внешний.

mikrotik-sstp-vpn-server-002.pngВ терминале все это можно быстро сделать командами:

/certificate 
add name=CA country="RU" state="31" locality="BEL" organization="Interface LLC" common-name="CA" key-size=2048 days-valid=3650 key-usage=crl-sign,key-cert-sign
sign CA ca-crl-host=127.0.0.1

Затем выпустим сертификат сервера. При этом надо определиться каким образом вы будете подключаться к серверу по IP-адресу или FQDN (доменному имени), второй вариант более предпочтителен, так как при смене адреса вам придется перевыпустить сертификат сервера и изменить настройки всех клиентских подключений.

Заполнение полей практически ничем не отличается от предыдущего сертификата, за исключением Common Name и Subject Alt. Name, в них указываем FQDN или IP-адрес сервера, для поля Subject Alt. Name также указываем тип: DNS — для доменного имени или IP для адреса. Срок действия сертификата также имеет смысл сделать достаточно большим, в нашем случае 10 лет.

mikrotik-sstp-vpn-server-003.pngНа закладке Key Usage устанавливаем digital-signature, key-encipherment и tls-server и подписываем сертификат сервера, для этого в поле CA выберите ранее выпущенный корневой сертификат.

mikrotik-sstp-vpn-server-004.pngВ терминале:

/certificate 
add name=sstp.interface31.lab country="RU" state="31" locality="BEL" organization="Interface LLC" common-name="sstp.interface31.lab" subject-alt-name=DNS:"sstp.interface31.lab" key-size=2048 days-valid=3650 key-usage=digital-signature,key-encipherment,tls-server
sign sstp.interface31.lab ca="CA"

При подключении через SSTP клиент прежде всего устанавливает с сервером защищенное соединения, а для этого ему нужно проверить сертификат и убедиться в его подлинности, в противном случае продолжение соединения будет невозможным. Чтобы клиентские системы доверяли нашим сертификатам нам нужно будет установить на них корневой сертификат нашего CA.

Для этого выберем корневой сертификат в System — Certificate, щелкнем на нем правой кнопкой мыши и нажмем Export, в поле Type ставим PEM, пароль не указываем, так как нам нужен только сертификат, без закрытого ключа. Закрытый ключ центра сертификации является секретным и никогда не должен покидать пределы роутера.

mikrotik-sstp-vpn-server-005.pngВ терминале сертификат можно экспортировать командой:

/certificate
export-certificate CA

Найти и скачать выгруженный сертификат можно в разделе Files.

Настройка SSTP VPN-сервера

Перед тем как браться за настройку сервера следует определиться со схемой доступа к сети, существуют два основных варианта: Proxy ARP, когда адреса удаленным клиентам выдаются из диапазона основной сети и они получают доступ без дополнительных настроек, и маршрутизация, когда диапазон адресов для VPN-клиентов не пересекается с основной сетью, а для доступа в нее будет необходимо указать маршруты, этот процесс можно автоматизировать с помощью PowerShell.

После этого перейдем в IP — Pool и создадим новый пул адресов для выдачи VPN-сервером, количество адресов в пуле не должно быть меньше предполагаемого количества клиентов.

mikrotik-sstp-vpn-server-006.pngВ терминале:

/ip pool
add name=sstp_pool ranges=10.20.0.100-10.20.0.199

Затем перейдем в PPP — Profiles и создадим новый профиль, в поле Local Address введем локальный адрес VPN-сервера, он должен относиться к тому же диапазону что и выделенный выше пул адресов, который следует указать в поле Remote Address, остальные настройки оставляем по умолчанию.

mikrotik-sstp-vpn-server-007.png

Или выполним команду:

/ppp profile
add local-address=10.20.0.1 name=SSTP-profile remote-address=sstp-pool

Затем переместимся в PPP — Secrets и создадим учетные записи пользователей, указываем имя пользователя, пароль, в поле Service выбираем sstp, что ограничит действие учетной записи только SSTP-сервером, если оставить any, то учетка сможет подключаться к любому сервису. В поле Profile указываем созданный нами профиль.

mikrotik-sstp-vpn-server-008.pngЭти же действия в командной строке:

/ppp secret
add name=Ivanov password=Pa$$word profile=SSTP-profile service=sstp

Теперь, когда все готово, настроим сам сервер. Для этого перейдем в PPP — Interface и нажмем кнопку SSTP Server. Включим его, установив флаг Enabled, в поле Default Profile выберем созданный нами профиль, в разделе Authentication оставим только mschap2, в поле Certificate указываем сертификат сервера. Дальнейшие настройки отвечают за повышение уровня безопасности: TLS Versiononly-1.2 не разрешает использование устаревших версий TLS, Force AES — заставляет принудительно использовать алгоритм шифрования AES256, PFS включает совершенную прямую секретность (Perfect forward secrecy), которая формирует уникальный сессионный ключ для каждого подключения, что делает невозможным расшифровку сессии даже при наличии закрытого ключа.

mikrotik-sstp-vpn-server-009.pngВ терминале для включения и настройки сервера выполните:

/interface sstp-server server
set authentication=mschap2 certificate=sstp.interface31.lab default-profile=SSTP-profile enabled=yes force-aes=yes pfs=yes tls-version=only-1.2

На этом настройка закончена, сервер готов принимать подключения.

Настройка подключения клиента в Windows

Как мы уже говорили, для того чтобы клиент мог проверить подлинность сервера нам необходимо импортировать корневой сертификат, переместим его на клиента и установим в Расположение хранилища — Локальный компьютер:

mikrotik-sstp-vpn-server-010.pngХранилище сертификатов — Доверенные корневые центры сертификации:

mikrotik-sstp-vpn-server-011.pngЗатем создаем подключение, в котором указываем Тип VPN — Протокол SSTP и Тип данных для входа — Имя пользователя и пароль, здесь же вводим адрес сервера и учетные данные.

mikrotik-sstp-vpn-server-012.pngПосле чего в свойствах подключения на закладке Безопасность убедимся, что в разделе Проверка подлинности указан только протокол MS-CHAP v2.

mikrotik-sstp-vpn-server-013.pngНастройка клиента закончена, можно подключаться.

Настройка подключения клиента в Linux

В используемых нами дистрибутивах Linux нет штатного SSTP-клиента, однако есть сторонняя разработка, которой мы и воспользуемся. Все нижесказанное будет справедливо для дистрибутивов основанных на Debian и Ubuntu, если у вас иная система обратитесь на страницу проекта.

Проще всего владельцам Ubuntu, им достаточно просто подключить PPA, ниже приведен пример для Ubuntu 18.04, для других систем просто измените кодовое название дистрибутива:

deb http://ppa.launchpad.net/eivnaes/network-manager-sstp/ubuntu bionic main 
deb-src http://ppa.launchpad.net/eivnaes/network-manager-sstp/ubuntu bionic main

В Debian процесс немного более сложный, сначала получим и установим ключ репозитория проекта:

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 61FF9694161CE595

Затем создадим файл с указанием источников пакетов:

touch /etc/apt/sources.list.d/sstp-client.list

И внесем в него следующие строки:

deb http://ppa.launchpad.net/eivnaes/network-manager-sstp/ubuntu eoan main 
deb-src http://ppa.launchpad.net/eivnaes/network-manager-sstp/ubuntu eoan main

Обновим список пакетов и установим клиент:

apt update
apt install network-manager-sstp

После чего появится возможность создать SSTP-соединение штатными средствами Network Manager. Настройки несложные: указываем адрес сервера, учетные данные и сертификат CA, у которого предварительно следует изменить расширение на PEM.

mikrotik-sstp-vpn-server-014.pngЕсли вы все сделали правильно, то соединение будет установлено.

Научиться настраивать MikroTik с нуля или систематизировать уже имеющиеся знания можно на углубленном курсе по администрированию MikroTik. Автор курса, сертифицированный тренер MikroTik Дмитрий Скоромнов, лично проверяет лабораторные работы и контролирует прогресс каждого своего студента. В три раза больше информации, чем в вендорской программе MTCNA, более 20 часов практики и доступ навсегда.

В статье разбирается настройка SSTP-туннеля на оборудовании MikroTik с целью подключения рабочего места сотрудника (client-to-site VPN). После создания VPN-канала между сетями будет работать маршрутизация и будет выполнена проверка работоспособности. Также будут разобраны типичные проблемы, которые могут возникнуть в процессе настройки и проверки.

Введение

Схема сети

Схема сети VPN на маршрутизаторах MikroTik

В головном офисе установлен маршрутизатор GW1. Он же будет настроен в качестве VPN-сервера. В этом же офисе работает сервер DC1, который является контроллером домена и параллельно выполняет функции DNS и WINS-сервера. К головному офису будет подключаться компьютер, который будет настроен как VPN-клиент.

Головной офис
IP-адрес внешней сети головного офиса: 10.1.100.0/24
IP-адрес внешнего интерфейса маршрутизатора GW1: 10.1.100.1/24

IP-адрес внутренней сети головного офиса: 192.168.15.0/24
IP-адрес внутреннего интерфейса маршрутизатора GW2: 192.168.15.1/24
IP-адрес сервера DC1: 192.168.15.10/24

Удаленный компьютер
IP-адрес удаленного компьютера: 10.1.200.1/24

VPN-канал
IP-адрес VPN-интерфейса маршрутизатора GW1: 172.16.30.101/32
Пулл адресов VPN-канала: 172.16.30.102 — 172.16.30.253

Полезные материалы по MikroTik

На Telegram-канале Mikrotik сэнсей можно получить доступ к закрытой информации от официального тренера MikroTik. В январе и феврале 2023 будут разбираться темы Wi-Fi и QoS. Подписывайтесь

Настройка

Настройка первого маршрутизатора

Через графический интерфейс

Включить SSTP Server:

Включение L2TP-сервера на маршрутизаторе МикроТик

Создать пул адресов для VPN-подключений:

Создание пула адресов для SSTP client-to-site на маршрутизаторе МикроТик

Создать профиль для VPN подключений. Указать адрес сервера DC1, который является DNS и WINS сервером. Без указания DNS и WINS VPN-подключение произойдет, но не будет возможности обращаться к узлам по именам.

Создание PPP-профиля для SSTP client-to-site на маршрутизаторе МикроТик

Добавить аккаунт пользователя:

Создание пользователя для SSTP client-to-site на маршрутизаторе МикроТик

На интерфейсе маршрутизатора, который смотрит в локальную сеть включить arp-proxy. Это нужно для того, чтобы удаленный клиент мог связываться с локальными хостами:

Включение arp-proxy для SSTP client-to-site на маршрутизаторе МикроТик

Через консоль

/interface sstp-server server
set authentication=mschap2 enabled=yes certificate=server

/ip pool
add name=vpn-pool ranges=172.16.30.102-172.16.30.253

/ppp profile
add name="SSTP client-to-site" local-address=172.16.30.101 remote-address=vpn-pool change-tcp-mss=yes dns-server=192.168.15.10 wins-server=192.168.15.10

/ppp secret
add name=user-laptop password=user-laptop-password profile="SSTP client-to-site" service=sstp

/interface ethernet
set ether1-LAN1 arp=proxy-arp

Настройка маршрутизации

Не требуется.

Следует учесть

  • AES является единственным алгоритмом, который поддерживается модулем аппаратного шифрования, если такой установлен на маршрутизатор.
  • Клиенты Windows не смогут подключиться, если сервер не использует сертификат.

Проверка

Для того, что бы проверить VPN-соединение достаточно запустить ping с компьютера VPN-клиента на любой компьютер в сети за маршрутизатором GW1.

Типичные проблемы

  • Если VPN-соединение не устанавливается, то надо проверить:
  1. Не мешает ли файервол. Для уверенности лучше временно отключить все правила файервола на маршрутизаторе.
  2. Совпадают ли имя пользователя, пароль и ключ IPsec.
  3. На VPN-клиенте указан правильный адрес VPN-сервера к которому должно происходить подключение.

Полезные материалы по MikroTik

На Telegram-канале Mikrotik сэнсей можно получить доступ к закрытой информации от официального тренера MikroTik. В январе и феврале 2023 будут разбираться темы Wi-Fi и QoS. Подписывайтесь

Полезные статьи

In this article, I will guide you through the setup process of the SSTP client in MikroTik RouterOS 5.26 and 6.xx. The client side setup does not depends on the type of VPN server.

The Microsoft Secure Socket Tunneling Protocol (SSTP) is the VPN technology based on the Point-to-Point Protocol (PPP) over Secured Socket Layer (SSL). As this protocol is based on the same mechanism as the Secured Web (HTTPS) protocol, it will pass virtually through every firewall or proxy server.

SSTP was first introduced back in 2007 in Windows Vista SP1/Windows 7/Server 2008. This protocol is declared as the Open Specification protocol, with the specification published on the Microsoft Docs portal.

It’s well supported in Windows 7/ Server 2008 R2 and later and MikroTik RouterOS v5.0 and later. You can have both client and server on both platforms. There is also the open-source client for Linux, but I didn’t test it yet.

I tried the different VPN clients for Android (on Android 5 and 9) and Cisco AnyConnect on iOS 12.4 here in my lab and I didn’t succeed at all. Therefore, I can say that those two platforms are not supported.

It has been developed as the client side VPN solution with idea to primary replace much weaker and older PPTP protocol. When Windows VPN client is set to automatic, this protocol will be selected before L2TP/IPSec or PPTP.

You can find the following tutorials related to the SSTP VPN clients on my blog:

  • MikroTik RouterOS SSTP server
  • Mikrotik RouterOS SSTP client (this article)
  • Windows 7 and later

Before we begin

The setup procedure is slightly different between the Mikrotik RouterOS versions. Therefore, we will show here setup for both RouterOS 6.36.3 and 5.26.

I need to highlight here that the SSTP services are part of the PPP suite and therefore you need to install the PPP package on your Mikrotik router.

As SSTP depends on the certificates, I will assume that these steps are already finished:

  • the root CA certificate is already loaded on both MikroTik clients
  • the SSTP VPN server is already configured

The RouterOS v6.x SSTP client

On Mikrotik devices that runs RouterOS version 6.x, you can set the SSTP VPN connection in a minute. Everything can be configure in one window or with the single command line.

Click on the PPP menu item. The new window will open. Here are all PPP connections on the device. Click on the button [ + ] and you can see drop-down menu with all available PPP interfaces.

01 - 6.36 add sstp client

Choose the SSTP client option from the list. The new window will open. You should configure all those options framed in red.

clip_image003

We need to enter the IP address of the VPN server and the credentials for access. We also need to choose the authentication protocol. It’s strongly advised to use these protocols checked on the screenshot (MS-CHAPv2 or CHAP).

Click on the button [ Apply ]. Mikrotik will create a new VPN connection. In a short while, Mikrotik will update the status of the connection.

03 - 6.36 test

Congratulations! You’ve just successfully made the VPN connection.

Should you use the Add Default Route option?

In case that you enable the option named Add Default Route, your device will use this SSTP link as the default path to the Internet. Even more, your VPN connection is often significantly slower than the direct Internet access. Therefore, use this option only if you have a need to force all network traffic through the distant site.

Additionally, we have this scenario with both PPPoE and SSTP connections. In such scenario, both connection have the option to add the default route. You need to configure carefully all routes in such scenario.

In this demonstration, I enabled this option only because it will automatically forward traffic to FabrikaM router. Therefore, my advice is to use the static route for such purpose.

Mikrotik devices with RouterOS v5.26 and earlier

Our second Mikrotik device uses RouterOS v5.26. On all RouterOS 5.x, we can set the SSTP connection, but we need to make a few extra steps.

I will reveal the secret to you. We need to manually add the static route to the FabirkaM network.

The first step is the same as above. Open the PPP menu. We will see the PPP window, where we can choose the drop-down menu with the list of available PPP interfaces. We will again select the SSTP client.

The newly opened window looks familiar, as it’s a very similar to that in RouterOS v6.x. The difference is that we don’t have the field for the distance of the default route.

Fill all necessary fields and click on the button [ Apply ]. Mikrotik will create the new VPN interface and in the short while, we will see the connection status update.

Congratulations again! You’ve successfully configured the SSTP tunnel.

Adding the static route

Alas, we don’t have all traffic automatically forwarded to the FabrikaM router. However, this route isn’t the problem for us. We will add it in a minute. Keep in mind that this scenario is more applicable in the real world.

05 - 5.26 routes

I clicked on the button [ + ] and filled the destination network (192.168.29.0/24) and the IP address of gateway (10.29.2.1 – the IP address assigned to the VPN server itself). I also like to add the distance, usually 5.

And the second router is also connected to the VPN server and we can ping the FabrikaM server.

06 - 5.26 test

Congratulations again! You’ve just successfully made the VPN connection.

The basic troubleshooting steps

In case that you can’t establish connection, check again all steps. In addition, use this check-list to confirm:

  • the client’s connectivity to the Internet
  • the connectivity of your VPN server (e.g. the Internet link status)
  • the Root CA certificate on the client
  • the server name in the router’s certificate – it should be FQDN or the IP address
  • the certificates on the router – you need both the Root CA and device’s certificate
  • the router’s firewall rules – you need to allow the TCP port 443 in the input chain.

For your convenience, I uploaded all configuration scripts I used for the FabrikaM server, Router03 and Router04. You can download them and use in your lab.

Stay tuned.

Понравилась статья? Поделить с друзьями:
  • Windows 10 rs2 или rs3 что это
  • Windows 10 ssh server change password
  • Windows 10 rs2 или rs3 как узнать какая
  • Windows 10 rollback utility скачать бесплатно с официального сайта
  • Windows 10 ssd не видит логический диск