Использование OpenVPN и создание сертификатов для SIP-телефонов

Описание модуля

Обзор

Виртуальная частная сеть, или VPN, представляет собой защищенное сетевое соединение, создаваемое поверх общедоступной сети. В отличие от обычного сетевого соединения, она использует специальные туннельные протоколы, обеспечивающие шифрование данных, проверку целостности и аутентификацию пользователей. Это помогает защитить передаваемую информацию от просмотра, изменения и копирования. С точки зрения безопасности сетевого соединения это похоже на создание выделенной частной линии в публичной сети. Поскольку такая линия является логической, а не физической, она называется виртуальной частной сетью. Система VPN включает VPN-сервер, VPN-клиенты и туннели. Передача данных через Интернет значительно дешевле аренды выделенной линии, поэтому VPN позволяет предприятиям безопасно и экономично передавать частную и конфиденциальную информацию через Интернет.
В данном руководстве описывается настройка VPN с помощью OpenVPN. OpenVPN — это сторонний инструмент с открытым исходным кодом для настройки виртуальной частной сети, который позволяет использовать существующие устройства для построения VPN-шлюза приложений.

Установка и настройка сервера

OpenVPN — это сторонний инструмент с открытым исходным кодом для настройки виртуальной частной сети, который позволяет использовать существующие устройства для построения VPN-шлюза приложений. Ниже описаны развертывание и настройка сервера в операционных системах Ubuntu и Windows.

Развертывание сервера OpenVPN в Ubuntu

2.1.1 Установка сервера OpenVPN
В Ubuntu введите следующие команды:
sudo apt-get -y install openvpn libssl-dev openssl
sudo apt-get -y install easy-rsa
2.1.2 Создание сертификатов
Выполните следующие команды, чтобы создать начальную конфигурацию сертификатов, необходимую для нормальной работы OpenVPN:
sudo mkdir /etc/openvpn/easy-rsa/
sudo cp -r /usr/share/easy-rsa/* /etc/openvpn/easy-rsa/
sudo su
sudo vi /etc/openvpn/easy-rsa/vars
----->При необходимости измените параметры сертификатов следующим образом:
export KEY_COUNTRY=”CN”
export KEY_PROVINCE=”BJ”
export KEY_CITY=”BeiJing”
export KEY_ORG=”fanvil”
export KEY_EMAIL=”fanvil@fanvil.com”
export KEY_OU=”fanvil”
export KEY_NAME=”server”
Запустить vars:    source vars
Если это первый запуск, очистите все:    ./clean-all
Создать сертификат CA:    ./build-ca
Создать сертификат сервера:    ./build-key-server server
Создать сертификат клиента:    ./build-key client
Создать библиотеку динамических ключей.    ./build-dh

Запуск сервера

Настройте серверную среду и поместите соответствующие файлы конфигурации сертификатов в указанный каталог:
cp keys/ca.crt /etc/openvpn/
cp keys/server.crt keys/server.key keys/dh2048.pem /etc/openvpn
mv /etc/openvpn/dh2048.pem /etc/openvpn/dh1024.pem
cp keys/client.key keys/client.crt   /etc/openvpn/
cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz /etc/openvpn/
cd /etc/openvpn
gzip -d server.conf.gz
cp /usr/share/doc/openvpn/examples/sample-config-files/client.conf /etc/openvpn/
Запустить сервер:
/etc/init.d/openvpn restart

Развертывание сервера OpenVPN в Windows

2.3.1 Установка сервера OpenVPN
Найдите в Интернете и загрузите версию OpenVPN для Windows. В данном примере используется OpenVPN GUI. Дважды щелкните загруженную программу и установите ее с параметрами по умолчанию. Во время установки обязательно выберите компонент easy-rsa. Путь по умолчанию: C:\Program Files\OpenVPN.
2.3.2 Создание сертификатов
Перед выполнением операции сначала выполните инициализацию среды:
Измените следующую часть файла C:\Program Files\OPENVPN\easy-rsa\vars.bat.sample в соответствии со своей ситуацией:
set HOME=C:\Program Files\OPENVPN\easy-rsa
set KEY_COUNTRY=CN    #(страна)
set KEY_PROVINCE=BEIJING    #(провинция)
set KEY_CITY= BEIJING    #(город)
set KEY_ORG=WINLINE    #(организация)
set KEY_EMAIL=admin@winline.com.cn    #(адрес электронной почты)
Строки, начинающиеся с #, являются комментариями. Не записывайте их в файл.
Откройте cmd с правами администратора, войдите в DOS и выполните следующие команды для перехода в каталог
openvpn\easy-rsa:
        init-config
        vars
        clean-all
Создать корневой сертификат:    build-ca (нажимайте Enter до конца, чтобы использовать конфигурацию по умолчанию)
Создать библиотеку динамических ключей:    build-dh
Создать сертификат сервера:    build-key-server server (нажимайте Enter до конца, чтобы использовать конфигурацию по умолчанию)
Создать сертификат клиента:    build-key client (нажимайте Enter до конца, чтобы использовать конфигурацию по умолчанию)
2.3.3 Запуск сервера
Все созданные ключи сохраняются в каталоге OpenVPN\easy-rsa\keys.
Скопируйте созданные сертификаты в каталог OpenVPN\config.
Скопируйте файл конфигурации сервера из OpenVPN\sample-config в каталог OpenVPN\config, затем запустите приложение OpenVPN.

Конфигурация на стороне сервера

В каталоге установки OpenVPN используйте notepad++ для открытия файла server.ovpn или server.conf. Пример серверного файла приведен ниже:
port 1194 # Этот порт назначен IANA для OpenVPN и может быть изменен при необходимости
proto udp # также можно выбрать tcp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
server 10.8.0.0 255.255.255.0 # Настройка сегмента виртуальной LAN; измените при необходимости
ifconfig-pool-persist ipp.txt
keepalive 10 120
client-to-client
comp-lzo
max-clients 100
persist-key
persist-tun
status openvpn-status.log
verb 3
Более подробную информацию можно найти в OpenVPN Wiki.

Использование и настройка клиента

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

Под клиентом здесь понимаются устройства, поддерживающие OpenVPN. Чтобы SIP-телефон мог подключиться к серверу OpenVPN, необходимы файлы сертификатов.
Сначала отредактируйте клиентский конфигурационный файл client.ovpn или client.conf. Пример клиентского конфигурационного файла приведен ниже:
client
dev tun
proto udp
remote 192.168.1.135 1194 # домен/IP сервера и порт
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key comp-lzo
verb 3
Вы можете изменить конфигурацию клиента в соответствии с настройками сервера.
Затем экспортируйте ранее созданные клиентские файлы ca.crt, client.crt и client.key для использования при обновлении SIP-телефона.

Использование OpenVPN на телефоне

Войдите на веб-страницу телефона и последовательно нажмите Сеть->VPN. В поле файлов OpenVPN поочередно загрузите client.ovpn, client.key, client.crt и ca.crt. После завершения загрузки в поле файлов OpenVPN будет отображен размер загруженных файлов сертификатов, как показано ниже:
Загрузка файлов OpenVPNОткройте страницу конфигурации VPN, выберите Open VPN в качестве режима VPN, включите VPN и нажмите кнопку Отправить. После успешного подключения к серверу в поле состояния VPN-соединения на странице VPN будет показан полученный IP-адрес. Как показано ниже, полученный IP-адрес — 10.8.0.10.
Открыть интерфейс настройки VPN

Включение VPN NAT

Интерфейс включения VPN NAT
Способ использования:
Импортируйте VPN-сертификаты в телефон, включите Enable VPN и Enable NAT, затем подключите ПК к LAN-порту телефона. Шлюз ПК должен быть установлен на IP-адрес телефона. После этого ПК сможет получить доступ к VPN телефона.
PC ping10.8.0.10 выполняется успешно, и ping www.baidu.com также выполняется успешно. 10.8.0.10 — это IP-адрес VPN.
Примечание: в настоящее время поддерживаются модели J3G/X3U/X3SG/J1P, а также X5S/X6/X7/X7C/X210/X210i. Телефоны X3S/X4/X7 пока не поддерживаются.

Каталог
обслуживание клиентов Телефон
We use cookie to improve your online experience. By continuing to browse this website, you agree to our use of cookie.

Cookies

This Cookie Policy explains how we use cookies and similar technologies when you access or use our website and related services. Please read this Policy together with our Terms and Conditions and Privacy Policy so that you understand how we collect, use, and protect information.

By continuing to access or use our Services, you acknowledge that cookies and similar technologies may be used as described in this Policy, subject to applicable law and your available choices.

Updates to This Cookie Policy

We may revise this Cookie Policy from time to time to reflect changes in legal requirements, technology, or our business practices. When we make updates, the revised version will be posted on this page and will become effective from the date of publication unless otherwise required by law.

Where required, we will provide additional notice or request your consent before applying material changes that affect your rights or choices.

What Are Cookies?

Cookies are small text files placed on your device when you visit a website or interact with certain online content. They help websites recognize your browser or device, remember your preferences, support essential functionality, and improve the overall user experience.

In this Cookie Policy, the term “cookies” also includes similar technologies such as pixels, tags, web beacons, and other tracking tools that perform comparable functions.

Why We Use Cookies

We use cookies to help our website function properly, remember user preferences, enhance website performance, understand how visitors interact with our pages, and support security, analytics, and marketing activities where permitted by law.

We use cookies to keep our website functional, secure, efficient, and more relevant to your browsing experience.

Categories of Cookies We Use

Strictly Necessary Cookies

These cookies are essential for the operation of the website and cannot be disabled in our systems where they are required to provide the service you request. They are typically set in response to actions such as setting privacy preferences, signing in, or submitting forms.

Without these cookies, certain parts of the website may not function correctly.

Functional Cookies

Functional cookies enable enhanced features and personalization, such as remembering your preferences, language settings, or previously selected options. These cookies may be set by us or by third-party providers whose services are integrated into our website.

If you disable these cookies, some services or features may not work as intended.

Performance and Analytics Cookies

These cookies help us understand how visitors use our website by collecting information such as traffic sources, page visits, navigation behavior, and general interaction patterns. In many cases, this information is aggregated and does not directly identify individual users.

We use this information to improve website performance, usability, and content relevance.

Targeting and Advertising Cookies

These cookies may be placed by our advertising or marketing partners to help deliver more relevant ads and measure the effectiveness of campaigns. They may use information about your browsing activity across different websites and services to build a profile of your interests.

These cookies generally do not store directly identifying personal information, but they may identify your browser or device.

First-Party and Third-Party Cookies

Some cookies are set directly by our website and are referred to as first-party cookies. Other cookies are set by third-party services, such as analytics providers, embedded content providers, or advertising partners, and are referred to as third-party cookies.

Third-party providers may use their own cookies in accordance with their own privacy and cookie policies.

Information Collected Through Cookies

Depending on the type of cookie used, the information collected may include browser type, device type, IP address, referring website, pages viewed, time spent on pages, clickstream behavior, and general usage patterns.

This information helps us maintain the website, improve performance, enhance security, and provide a better user experience.

Your Cookie Choices

You can control or disable cookies through your browser settings and, where available, through our cookie consent or preference management tools. Depending on your location, you may also have the right to accept or reject certain categories of cookies, especially those used for analytics, personalization, or advertising purposes.

Please note that blocking or deleting certain cookies may affect the availability, functionality, or performance of some parts of the website.

Restricting cookies may limit certain features and reduce the quality of your experience on the website.

Cookies in Mobile Applications

Where our mobile applications use cookie-like technologies, they are generally limited to those required for core functionality, security, and service delivery. Disabling these essential technologies may affect the normal operation of the application.

We do not use essential mobile application cookies to store unnecessary personal information.

How to Manage Cookies

Most web browsers allow you to manage cookies through browser settings. You can usually choose to block, delete, or receive alerts before cookies are stored. Because browser controls vary, please refer to your browser provider’s support documentation for details on how to manage cookie settings.

Contact Us

If you have any questions about this Cookie Policy or our use of cookies and similar technologies, please contact us at support@becke.cc .