- Connecting to Access Server with Windows
- Installing a client application
- OpenVPN Connect with your Access Server
- Steps: Access your Client UI
- OpenVPN Connect v3
- OpenVPN Connect v2
- Alternative OpenVPN open source client: OpenVPN GUI
- Alternative OpenVPN client: tunXten
- Alternative OpenVPN client: Viscosity
- Other client GUI projects
- Helpful Resources
- Как настроить сервер OpenVPN на Windows
- Установка OpenVPN Server
- Создание сертификатов
- Настройка сервера
- Настройка клиента
- Пошаговая настройка OpenVPN в Windows
- Настраиваем сервер.
- Пора создавать сертификаты
- Настройка клиента
Connecting to Access Server with Windows
Each Windows device needs a client application to connect with your OpenVPN Access Server. We recommend using OpenVPN Connect, which is pre-configured to connect with your Access Server. This document provides information on using OpenVPN Connect as well as alternative solutions.
Installing a client application
The OpenVPN protocol is not built into Windows. Therefore, you must install a client app to handle communication with Access Server. A client app is required to capture the traffic you want to send through the OpenVPN tunnel, encrypt it, pass it on to the server, and decrypt the return traffic.
OpenVPN Connect with your Access Server
Your installation of OpenVPN Access Server includes a copy of OpenVPN Connect, which is a separate package called openvpn-as-bundled-clients that is updated when new versions of OpenVPN Connect are released. OpenVPN Connect is our official client app and your users can download it directly from your client UI, pre-configured to connect with your server, or download it separately from our website and import a connection profile.
Steps: Access your Client UI
- Open a browser and enter your Access Server IP address or the custom hostname if you have set that up (recommended).
- Enter your username and password.
- Once you have signed in, the recommended OpenVPN Connect app for your device displays at the top. Also shown are downloads for other platforms as well as connection profiles.
OpenVPN Connect only supports one active VPN tunnel at a time. It was purposely designed to not support connections to two or more servers simultaneously. Connecting to two servers at the same time requires two different adjustments to the routing table on the client computer. Therefore, it is very easy to make a mistake and break connectivity or cause traffic to flow to the wrong destination. Limiting connections to one server ensures connectivity and traffic flow. OpenVPN Connect can store many profiles for different servers, but you can only actively connect to one at a time.
OpenVPN Connect also supports client-side scripting, importing connection profiles directly from Access Server, and connecting with a server-locked profile. A server-locked profile enables you to authenticate any valid user on your Access Server without installing unique connection profiles for each user.
OpenVPN Connect v3
We recommend and support OpenVPN Connect v3 as the official app for OpenVPN Access Server and OpenVPN Cloud. The client software offers client connectivity across four major platforms: Windows, macOS, Android, and iOS. For Linux, we recommend the open source OpenVPN client.
You can run OpenVPN Connect v3 as a Windows system service, which is especially helpful if you need to activate the VPN before a user signs in. For more details, refer to Use OpenVPN Connect v3 on Windows in Service Daemon Mode.
We recommend downloading OpenVPN Connect v3 directly from your Access Server web client UI. You can also download the installation file for OpenVPN Connect v3 from the download page on our site or with the link below. The app installation from our site does not contain any connection settings, so you’ll need to take additional steps to configure the connection to your Access Server. If you are installing the below file on a computer that already has OpenVPN Connect v3 installed and configured, it simply updates it to the latest version and retains all settings.
OpenVPN Connect v2
OpenVPN Connect v2 is the previous generation of OpenVPN Connect client software for OpenVPN Access Server. Support for OpenVPN Connect v2 ends in 2022. We strongly recommend using OpenVPN Connect v3.
Alternative OpenVPN open source client: OpenVPN GUI
The open source project also has a Windows client called OpenVPN GUI. OpenVPN GUI supports the option to connect to multiple OpenVPN servers at the same time, but doing so requires careful configuration to avoid conflicting routes and subnets. Note that you must also make sure there are enough virtual network adapters. On Windows, OpenVPN creates a virtual network card or adapter, but only one OpenVPN tunnel can connect to a virtual network adapter. If you require three simultaneous OpenVPN tunnel connections, you must manually add adapters using command line scripts in the Start menu.
Similar to OpenVPN Connect v3, OpenVPN GUI also includes a service daemon mode where a connection starts up as a system service on Windows before the user is signed in. For more details, refer to Running OpenVPN as a Windows Service.
You can save OpenVPN connection profiles into the program’s config directory, usually located at C:\program files (x86)\openvpn\config\ with .conf or .ovpn file extensions. For example, you can download a user-locked or auto-login profile from the OpenVPN Access Server web interface and place it in this directory. The system tray menu displays the options to use with this connection profile.
OpenVPN GUI doesn’t support client-side scripting, importing connection profiles directly from an Access Server, or connecting with a server-locked profile.
You can download OpenVPN GUI from the community downloads section on our site and download the installer for Windows. The OpenVPN GUI program comes included with this installer.
The program is limited to 50 connection profiles.
Alternative OpenVPN client: tunXten
tunXten is a third-party client created by Eugene Mindrov. tunXten is only available for Windows and is compatible with OpenVPN Access Server. tunXten supports importing connection profiles directly from the Access Server and can also support multiple simultaneous OpenVPN tunnel connections. Just like the open source version, tunXten needs multiple virtual network adapters to do this, but it comes with a GUI tool to achieve this. You can simply keep adding adapters until you have the required number to establish as many connections as you need. It comes with useful logging information and the ability to place custom icons on connections, rename profiles in the GUI, set connections to automatically connect at boot up, remember saved usernames and passwords, and so on.
Alternative OpenVPN client: Viscosity
Viscosity is another third-party OpenVPN client created by SparkLabs. Viscosity is available for Windows and macOS, and is compatible with OpenVPN Access Server.
Other client GUI projects
There are many VPN clients built for the OpenVPN protocol that also work with OpenVPN Access Server. Refer to the community website for the current list.
Helpful Resources
The following resources may be helpful for VPN configuration details, if needed:
Как настроить сервер OpenVPN на Windows
OpenVPN позволяет настроить VPN-сервер как на платформе Windows Server, так и версии для рабочего компьютера (Windows 10, 8, 7).
Установка OpenVPN Server
Переходим на официальный сайт OpenVPN и скачиваем последнюю версию программы для соответствующей версии Windows:
Запускаем скачанный файл — нажимаем Next — I Agree — и выставляем галочку EasyRSA 2 Certificate Management Scripts (нужен для возможности сгенерировать сертификаты):
. снова Next и Install — начнется установка. В процессе мастер может выдать запрос на подтверждение установки виртуального сетевого адаптера — соглашаемся (Install/Установить).
После завершения нажимаем Next — снимаем галочку Show Readme — Finish.
Создание сертификатов
Переходим в папку установки OpenVPN (по умолчанию, C:\Program Files\OpenVPN) и создаем каталог ssl.
После переходим в папку C:\Program Files\OpenVPN\easy-rsa, создаем файл vars.bat, открываем его на редактирование и приводим к следующему виду:
set «PATH=%PATH%;%ProgramFiles%\OpenVPN\bin»
set HOME=%ProgramFiles%\OpenVPN\easy-rsa
set KEY_CONFIG=openssl-1.0.0.cnf
set KEY_DIR=keys
set KEY_SIZE=2048
set KEY_COUNTRY=RU
set KEY_PROVINCE=Sankt-Petersburg
set KEY_CITY=Sankt-Petersburg
set KEY_ORG=Organization
set KEY_EMAIL=master@dmosk.ru
set KEY_CN=DMOSK
set KEY_OU=DMOSK
set KEY_NAME=server.domain.ru
set PKCS11_MODULE_PATH=DMOSK
set PKCS11_PIN=12345678
* в каталоге easy-rsa уже есть файл vars.bat.sample — можно переименовать и использовать его.
** значение HOME не меняем, если оставили путь установки программы по умолчанию; KEY_DIR — каталог, куда будут генерироваться сертификаты; KEY_CONFIG может быть разным — его лучше посмотреть в файле vars.bat.sample или по названию соответствующего файла в папке easy-rsa; KEY_NAME желательно, чтобы соответствовал полному имени VPN-сервера; остальные опции можно заполнить произвольно.
Запускаем командную строку от имени администратора:
Переходим в каталог easy-rsa:
Чистим каталоги от устаревшей информации:
Снова запускаем vars.bat (после clean переопределяются некоторые переменные):
Теперь генерируем последовательность центра сертификации:
На все запросы нажимаем Enter.
Запускаем build-dh.bat (сертификат с использованием алгоритма Диффи-Хеллмана):
openssl dhparam -out keys\dh.pem 2048
* команда может выполняться долго — это нормально.
Генерируем сертификат для сервера:
* где cert — имя сертификата; на все запросы нажимаем Enter. В конце подтверждаем два раза корректность информации вводом y.
После переносим из папки C:\Program Files\OpenVPN\easy-rsa\keys в C:\Program Files\OpenVPN\ssl следующие файлы:
Настройка сервера
Переходим в папку C:\Program Files\OpenVPN\config и создаем файл server.ovpn. Открываем его на редактирование и приводим к следующему виду:
port 443
proto udp
dev tun
dev-node «VPN Server»
dh «C:\\Program Files\\OpenVPN\\ssl\\dh.pem»
ca «C:\\Program Files\\OpenVPN\\ssl\\ca.crt»
cert «C:\\Program Files\\OpenVPN\\ssl\\cert.crt»
key «C:\\Program Files\\OpenVPN\\ssl\\cert.key»
server 172.16.10.0 255.255.255.0
max-clients 32
keepalive 10 120
client-to-client
comp-lzo
persist-key
persist-tun
cipher DES-CBC
status «C:\\Program Files\\OpenVPN\\log\\status.log»
log «C:\\Program Files\\OpenVPN\\log\\openvpn.log»
verb 4
mute 20
* где port — сетевой порт (443 позволит избежать проблем при использовании Интернета в общественных местах, но может быть любым из свободных, например 1194, занятые порты в Windows можно посмотреть командой netstat -a); dev-node — название сетевого интерфейса; server — подсеть, в которой будут работать как сам сервер, так и подключенные к нему клиенты.
** так как в некоторых путях есть пробелы, параметр заносится в кавычках.
*** при использовании другого порта необходимо проверить, что он открыт в брандмауэре или на время тестирования отключить его.
В сетевых подключениях Windows открываем управление адаптерами — TAP-адаптер переименовываем в «VPN Server» (как у нас указано в конфигурационном файле, разделе dev-node):
Теперь открываем службы Windows и находим «OpenVpnService». Открываем ее, настраиваем на автозапуск и включаем:
Ранее переименованный сетевой интерфейс должен включиться:
VPN-сервер работает. Проверьте, что сетевой адаптер VPN Server получил IP 172.16.10.1. Если он получает что-то, на подобие, 169.254. выключаем сетевой адаптер — перезапускаем службу OpenVpnService и снова включаем сетевой адаптер.
Настройка клиента
На сервере:
На сервере генерируем сертификат для клиента. Для этого сначала чистим файл index.txt в папке C:\Program Files\OpenVPN\easy-rsa\keys.
Затем запускаем командную строку от имени администратора:
Пошаговая настройка OpenVPN в Windows
Появилась у меня необходимость подключаться к компьютеру, находящемуся в локальной сети офиса из дома. Как варианты, рассматривал различные решения, будь то Team Viewer ,ssh-тунель и т.д., но в итоге было решено остановиться на OpenVpn, ввиду гарантированной безопасности, надежности соединения и фриварности софта.
Но к своему удивлению любую инструкцию, приходилось в той или иной степени дорабатывать. Поэтому решил предложить вашему вниманию свой вариант. Инструкция «сухая» без особых объяснений конфигов, рассчитанная на то, что можно особо не вдаваясь в смысл поднять шифрованный туннель.
Для начала, конечно, скачиваем программу с официального сайта(http://openvpn.net/index.php/download/community-downloads.html). Далее рекомендую установить её в директорию «c:\openvpn», дабы потом не возникало лишних проблем с путями. Также сразу надо создать «c:\openvpn\ssl», после поместим сюда все наши «ключики», «с:\OpenVPN\log\openvpn.log» и «с:\OpenVPN\log\openvpn-status.log» — для записи логов.
Приступаем к редактированию всех наших конфигов.Чтобы офисный файервол не мешал будущему соединению настроим серверную часть дома на ПК, а клиентскую на рабочем.
Настраиваем сервер.
#
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#
# This definition stops the following lines choking if HOME isn’t
# defined.
HOME =.
RANDFILE = $ENV::HOME/.rnd
# Extra OBJECT IDENTIFIER info:
#oid_file = $ENV::HOME/.oid
oid_section = new_oids
# To use this configuration file with the «-extfile» option of the
# «openssl x509» utility, name here the section containing the
# X.509v3 extensions to use:
# extensions =
# (Alternatively, use a configuration file that has only
# X.509v3 extensions in its main [= default] section.)
# We can add new OIDs in here for use by ‘ca’ and ‘req’.
# Add a simple OID like this:
# testoid1=1.2.3.4
# Or use config file substitution like this:
# testoid2=$
dir = $ENV::KEY_DIR # Where everything is kept
certs = $dir # Where the issued certs are kept
crl_dir = $dir # Where the issued crl are kept
database = $dir/index.txt # database index file.
new_certs_dir = $dir # default place for new certs.
certificate = $dir/ca.crt # The CA certificate
serial = $dir/serial # The current serial number
crl = $dir/crl.pem # The current CRL
private_key = $dir/ca.key # The private key
RANDFILE = $dir/.rand # private random number file
x509_extensions = usr_cert # The extentions to add to the cert
# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
# so this is commented out by default to leave a V1 CRL.
# crl_extensions = crl_ext
default_days = 3650 # how long to certify for
default_crl_days= 30 # how long before next CRL
default_md = md5 # which md to use.
preserve = no # keep passed DN ordering
# A few difference way of specifying how similar the request should look
# For type CA, the listed attributes must be the same, and the optional
# and supplied fields are just that 🙂
policy = policy_match
# For the CA policy
[ policy_match ]
countryName = match
stateOrProvinceName = match
organizationName = match
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
# For the ‘anything’ policy
# At this point in time, you must list all acceptable ‘object’
# types.
[ policy_anything ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
####################################################################
[ req ]
default_bits = $ENV::KEY_SIZE
default_keyfile = privkey.pem
distinguished_name = req_distinguished_name
attributes = req_attributes
x509_extensions = v3_ca # The extentions to add to the self signed cert
# Passwords for private keys if not present they will be prompted for
# input_password = secret
# output_password = secret
# This sets a mask for permitted string types. There are several options.
# default: PrintableString, T61String, BMPString.
# pkix: PrintableString, BMPString.
# utf8only: only UTF8Strings.
# nombstr: PrintableString, T61String (no BMPStrings or UTF8Strings).
# MASK:XXXX a literal mask value.
# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings
# so use this option with caution!
string_mask = nombstr
# req_extensions = v3_req # The extensions to add to a certificate request
[ req_distinguished_name ]
countryName = Country Name (2 letter code)
countryName_default = $ENV::KEY_COUNTRY
countryName_min = 2
countryName_max = 2
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = $ENV::KEY_PROVINCE
localityName = Locality Name (eg, city)
localityName_default = $ENV::KEY_CITY
0.organizationName = Organization Name (eg, company)
0.organizationName_default = $ENV::KEY_ORG
# we can do this but it is not needed normally 🙂
#1.organizationName = Second Organization Name (eg, company)
#1.organizationName_default = World Wide Web Pty Ltd
organizationalUnitName = Organizational Unit Name (eg, section)
#organizationalUnitName_default =
commonName = Common Name (eg, your name or your server\’s hostname)
commonName_max = 64
emailAddress = Email Address
emailAddress_default = $ENV::KEY_EMAIL
emailAddress_max = 40
# SET-ex3 = SET extension number 3
[ req_attributes ]
challengePassword = A challenge password
challengePassword_min = 4
challengePassword_max = 20
unstructuredName = An optional company name
# These extensions are added when ‘ca’ signs a request.
# This goes against PKIX guidelines but some CAs do it and some software
# requires this to avoid interpreting an end user certificate as a CA.
# Here are some examples of the usage of nsCertType. If it is omitted
# the certificate can be used for anything *except* object signing.
# This is OK for an SSL server.
# nsCertType = server
# For an object signing certificate this would be used.
# nsCertType = objsign
# For normal client use this is typical
# nsCertType = client, email
# and for everything including object signing:
# nsCertType = client, email, objsign
# This is typical in keyUsage for a client certificate.
# keyUsage = nonRepudiation, digitalSignature, keyEncipherment
# This will be displayed in Netscape’s comment listbox.
nsComment = «OpenSSL Generated Certificate»
# PKIX recommendations harmless if included in all certificates.
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer:always
# This stuff is for subjectAltName and issuerAltname.
# Import the email address.
# subjectAltName=email:copy
# Copy subject details
# issuerAltName=issuer:copy
#nsCaRevocationUrl = www.domain.dom/ca-crl.pem
#nsBaseUrl
#nsRevocationUrl
#nsRenewalUrl
#nsCaPolicyUrl
#nsSslServerName
# JY ADDED — Make a cert with nsCertType set to «server»
basicConstraints=CA:FALSE
nsCertType = server
nsComment = «OpenSSL Generated Server Certificate»
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer:always
# Extensions to add to a certificate request
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
# Extensions for a typical CA
# This is what PKIX recommends but some broken software chokes on critical
# extensions.
#basicConstraints = critical,CA:true
# So we do this instead.
basicConstraints = CA:true
# Key usage: this is typical for a CA certificate. However since it will
# prevent it being used as an test self-signed certificate it is best
# left out by default.
# keyUsage = cRLSign, keyCertSign
# Some might want this also
# nsCertType = sslCA, emailCA
# Include email address in subject alt name: another PKIX recommendation
# subjectAltName=email:copy
# Copy issuer details
# issuerAltName=issuer:copy
# DER hex encoding of an extension: beware experts only!
# obj=DER:02:03
# Where ‘obj’ is a standard or added object
# You can even override a supported extension:
# basicConstraints= critical, DER:30:03:01:01:FF
# CRL extensions.
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
Копируем index.txt.start в index.txt, а serial.start в serial в папку ssl
Пора создавать сертификаты
Отправляем CA.crt, klient.crt, klient.key, ta.key из «c:\openvpn\ssl» нашим клиентам (помещаем их в такую же директорию « c:\openvpn\ssl»).
Настройка клиента
На сервере запускаем файл server.ovpn(кнопка «StartOpenvpn…» в контекстном меню), на клиенте clientVPN.ovpn. При необходимости изменяем тип запуска нашей службы(OpenVPN Service) на «Автоматически». Туннель поднят, можете смело заходить на работу, допустим по RDP. Адрес сервера в нашей виртуальной сети будет 192.168.0.1. Надеюсь, этот пост сократит время для настройки OpenVpn, даже для самых начинающих до нескольких минут.
Данная статья не подлежит комментированию, поскольку её автор ещё не является полноправным участником сообщества. Вы сможете связаться с автором только после того, как он получит приглашение от кого-либо из участников сообщества. До этого момента его username будет скрыт псевдонимом.
Это «Песочница» — раздел, в который попадают дебютные посты пользователей, желающих стать полноправными участниками сообщества.
Если у вас есть приглашение, отправьте его автору понравившейся публикации — тогда её смогут прочитать и обсудить все остальные пользователи Хабра.
Чтобы исключить предвзятость при оценке, все публикации анонимны, псевдонимы показываются случайным образом.
Не надо пропускать:
- рекламные и PR-публикации
- вопросы и просьбы (для них есть Хабр Q&A);
- вакансии (используйте Хабр Карьеру)
- статьи, ранее опубликованные на других сайтах;
- статьи без правильно расставленных знаков препинания, со смайликами, с обилием восклицательных знаков, неоправданным выделением слов и предложений и другим неуместным форматированием текста;
- жалобы на компании и предоставляемые услуги;
- низкокачественные переводы;
- куски программного кода без пояснений;
- односложные статьи;
- статьи, слабо относящиеся к или не относящиеся к ней вовсе.