Why doesn’t automatic DNS server configuration work when connecting to macOS and Linux using the OpenVPN client | Почему не работает автоматическая настройка DNS-сервера при подключении на macOS и Linux с помощью клиента OpenVPN |
Due to the architectural features of the Linux and macOS operating systems, automatic DNS server configuration when using the official OpenVPN client is not possible. | В связи с архитектурными особенностями операционных систем семейства Linux и macOS автоматическая конфигурация DNS-сервера при подключении с помощью официального клиента OpenVPN невозможна. |
To configure the DNS server on such operating systems, the service provides the ability to use third-party scripts that run when the client connects or disconnects. | Для настройки DNS-сервера в таких ОС сервисом предусмотрена возможность использования сторонних скриптов, которые запускаются при подключении и отключении клиента. |
In the client configurations generated by the module, the blocks responsible for these settings are predefined and commented out: | В клиентских конфигурациях, генерируемых модулем, предопределены и закомментированы блоки, отвечающие за эти настройки: |
bash | bash |
Uncomment the lines below for use with Linux | Uncomment the lines below for use with Linux |
script-security 2 | script-security 2 |
If you use resolved | If you use resolved |
up /etc/openvpn/update-resolv-conf | up /etc/openvpn/update-resolv-conf |
down /etc/openvpn/update-resolv-conf | down /etc/openvpn/update-resolv-conf |
If you use systemd-resolved, first install the openvpn-systemd-resolved package | If you use systemd-resolved, first install the openvpn-systemd-resolved package |
up /etc/openvpn/update-systemd-resolved | up /etc/openvpn/update-systemd-resolved |
down /etc/openvpn/update-systemd-resolved | down /etc/openvpn/update-systemd-resolved |
To use these code blocks, uncomment them (remove the initial | Для активации указанных блоков кода необходимо их раскомментировать (удалить начальный символ |
You can either prepare the scripts yourself or use ready-made scripts from the official OpenVPN Community (for Linux). For macOS, you can use a third-party script. | Скрипты можно подготовить самостоятельно или воспользоваться готовыми решениями от официального OpenVPN Community (для Linux). Для macOS можно воспользоваться сторонним скриптом. |
Scripts must have execution permissions. | Скрипты должны обладать правами на исполнение. |
How to revoke, rotate or delete a user certificate | Как отозвать, ротировать или удалить сертификат клиента |
All operations with client certificates are performed via the openvpn-admin web interface. Buttons for managing certificates are available to the right of each user’s name: | Все действия с клиентскими сертификатами выполняются через веб-интерфейс |
|
|
To rotate (issue a new certificate) or delete a client, you must first revoke their current certificate: | Чтобы ротировать (выпустить новый сертификат) или удалить клиента, необходимо сначала отозвать его текущий сертификат (Revoke): |
|
|
Once revoked, the Renew (rotation) and Delete (removal) actions become available. | После отзыва становятся доступными действия Renew (ротация) и Delete (удаление). |
How to rotate a server certificate | Как ротировать сертификат сервера |
The server certificate is rotated automatically several days before it expires. | Серверный сертификат ротируется автоматически за 1 день до окончания срока его действия. |
If you need to rotate the certificate manually (e.g., due to certificate corruption or an unscheduled replacement), follow these steps: | Если требуется выполнить ротацию вручную (например, при повреждении сертификата или внеплановой замене), выполните следующие шаги: |
|
|
shell kubectl -n d8-openvpn delete secrets openvpn-pki-server | shell kubectl -n d8-openvpn delete secrets openvpn-pki-server |
|
|
shell kubectl -n d8-openvpn rollout restart sts openvpn | shell kubectl -n d8-openvpn rollout restart sts openvpn |
A new certificate will be generated automatically when the pods start. | Как ротировать корневой сертификат (CA) |
How to rotate a root certificate (CA) | Корневой сертификат (CA) и серверный сертификат ротируется автоматически за 1 день до окончания срока действия. Автоматическая ротация сертификатов пользователя не предусмотрена. Корневой сертификат (CA) используется для подписи всех сертификатов в OpenVPN — как серверных, так и клиентских. Поэтому при его замене необходимо перевыпустить все зависимые сертификаты. |
The root certificate (CA) and server certificate are rotated automatically 1 day before expiration. Automatic rotation of clients certificates is not provided. The root certificate (CA) is used to sign all certificates in OpenVPN — both server and client. Therefore, when replacing the CA, you must reissue all dependent certificates. | Шаги для ротации корневого сертификата: |
Steps to rotate the root certificate: |
|
|
|
| shell kubectl -n d8-openvpn delete secrets openvpn-pki-ca openvpn-pki-server |
shell kubectl -n d8-openvpn delete secrets openvpn-pki-ca openvpn-pki-server |
|
| shell kubectl -n d8-openvpn rollout restart sts openvpn |
shell kubectl -n d8-openvpn rollout restart sts openvpn |
|
|
|
| shell kubectl -n d8-openvpn delete secrets -l revokedForever=true |
shell kubectl -n d8-openvpn delete secrets -l revokedForever=true |