OpenVPN istemcisi ve sunucusu
OpenVPN, VPN bağlantısı için en popüler protokollerden biridir. Sanal bir özel ağ oluşturmak veya yerel ağları birbirine bağlamak için kullanılabilir. OpenVPN açık kaynaklıdır ve GNU GPL lisansı ile ücretsiz olarak dağıtılır. Diğer VPN protokollerinden daha yüksek bağlantı hızları sağlar. Ayrıca, OpenVPN en güvenli protokollerden biri olarak adlandırılabilir. İletilen tüm veriler, yüksek güvenlik ve anonimlik sağlayan OpenSSL şifreleme kitaplığı ve SSLv3 / TLSv1 protokolleri ile güvenli bir şekilde korunur.
[en] Keenetic router features TCP and UDP mode for OpenVPN connection, TLS authentication, use of certificates and encryption keys to increase the security of VPN connection.
Önemli
OpenVPN sunucusunu barındıracak Keenetic yönlendirici, global bir IP adresiyle Internet'e bağlı olmalı ve KeenDNS etki alanı adını kullanırken, Doğrudan erişim modunda yapılandırılmalıdır. Bu koşullardan herhangi biri karşılanmazsa, İnternet'ten böyle bir sunucuya bağlanmak mümkün olmayacaktır.
[en] Installing the system component 'OpenVPN client' is necessary to configure the OpenVPN connection. With this component, you can use both client and OpenVPN server in your Keenetic. A detailed description of the client mode you may find in the article 'OpenVPN client'. You can install the system component on the 'General system settings' page in the 'Updates and components' section by clicking 'Component options'.

OpenVPN modu (istemci veya sunucu) temel olarak yapılandırma dosyası tarafından tanımlanır.
Önemli
Keenetic'de kullanım için OpenVPN yapılandırma gereksinimleri:
Yapılandırma tek bir dosyada olmalıdır.
Sertifikalar, anahtarlar, vb. Bu dosyaya dahil edilmelidir.
Yapılandırmada yalnızca belgede listelenen seçenekleri kullanmalısınız: OpenVPN 2.4 ManPage
Yukarıda açıklanan seçeneklerin bazıları desteklenmeyebilir. Örneğin, OpenVPN uygulamamız IPv6 ile ilgili seçenekleri desteklemez.
Seçeneklerin sırası ve etkinleştirilmiş sertifikalar ve anahtarlar önemli değildir.
[en] OpenSSL keys must be set without a password because Keenetic's interface does not have an option to enter it.
OpenVPN yapılandırma dosyası başlangıç-yapılandırma yapılandırma dosyasına kaydedilmez. OpenVPN istemci arayüzü ayarlarının yedeğini almak için ayrı olarak kaydetmeniz gerekir.
[en] The number of client connections is limited by the allocated service memory partition size of 24 Kbytes
for storing VPN configurations. This is especially important for OpenVPN connections because the total size of their configurations must not exceed 24 Kbytes
.
'Siteden siteye
' türündeki OpenVPN'i bağlama örneğini ele alalım.

Keenetic#2 istemcisini (Ev segmenti 192.168.2.0/24
, tünel adresi: 10.1.0.2
) Keenetic#1'deki (Ev segmenti 192.168.1.0/24
, tünel adresi: 10.1.0.1
) sunucuya bağlayacağız
İlk olarak, paylaşılan bir gizli anahtar kullanarak en basit yapılandırmaya bakalım.
Keenetic#1 için minimum OpenVPN sunucusunun yapılandırması:
dev tun ifconfig 10.1.0.1 10.1.0.2 cipher AES-128-CBC <secret> <--insert the secret key here </secret> verb 3 route 192.168.2.0 255.255.255.0
Keenetic#2 için minimum OpenVPN istemcisi yapılandırması:
dev tun remote KEENETIC-1.mykeenetic.net <-- server's domain name or IP address ifconfig 10.1.0.2 10.1.0.1 cipher AES-128-CBC <secret> <--insert the secret key here </secret> verb 3 route 192.168.1.0 255.255.255.0 or redirect-gateway def1 or route 0.0.0.0 0.0.0.0 <-- if it's neccessary to route all the traffic in the tunnel
Paylaşılan bir gizli anahtar oluşturun. Bunu yapmak için buradan OpenVPN'i indirin ve yükleyin: https://openvpn.net/index.php/download/community-downloads.html
Bu örnekte Windows için
2.4.6-I602
sürümünü kullanacağız.Yazılımı yükledikten sonra bilgisayarı yeniden başlatın.
Varsayılan olarak, program
C:\Program
klasörüne yüklenecektir.Windows komut satırını yönetici olarak çalıştırın.
C:\Program Files\OpenVPN\bin
adresine gidin ve şu komutu çalıştırın:openvpn.exe --genkey --secret static.key
Oluşturulan
static.key
dosyasını herhangi bir metin düzenleyicisinde (örn. Not Defteri) paylaşılan gizli anahtarla açın, içeriğini panoya (Ctrl-A
,Ctrl-C
) kopyalayın ve (Ctrl-V
) istemci ve sunucu yapılandırma dosyaları.Keenetic # 1 için static-server.ovpn yapılandırma dosyalarına ve paylaşılan gizli anahtarlı Keenetic # 2 için static-client.ovpn yapılandırma dosyalarına örnekler bu makalenin sonuna eklenmiştir. Bu dosyalarda, gerekirse daha sonra kullanılabilecek başka yorumlanmış ('
;
' ile başlayan) ayarlar da vardır.Static-client.ovpn
içindekiKEENETIC-1.mykeenetic.tr
etki alanı adını Keenetic # 1 etki alanı adınızla veya genel IP adresinizle değiştirerek doğrulama için bu yapılandırma dosyalarını kullanabilirsiniz. her iki dosyada da oluşturulur.Keenetic'in web arayüzündeki 'Diğer bağlantılar' sayfasına gidin ve 'VPN bağlantıları' bölümündeki 'Bağlantı oluştur'u tıklayın. 'VPN bağlantı ayarları' penceresinde, 'Tür (protokol)' alanında 'OpenVPN' seçeneğini seçin.
Ardından 'Bağlantı adı' alanına bağlantının adını girin ve 'OpenVPN yapılandırması' alanına
static-server.ovpn
yapılandırma dosyasının içeriğini ekleyin. Ayarları kaydedin.Önemli
[en] From KeeneticOS
3.4.1
the server only works when 'Connect via' — 'Any Internet connection' is specified.Aynı şekilde, ikinci Keenetic'in web arabirimine bir
static-client.ovpn
yapılandırmasıyla bir OpenVPN bağlantısı ekleyin:Ayrıca, Keenetic # 1 (sunucu) tarafında, yönlendiricinin komut satırı arabirimi (CLI) üzerinden aşağıdaki komutların yürütülmesi gerekir:
interface OpenVPN0 no ip global interface OpenVPN0 security-level private
Özel güvenlik düzeyine sahip
Home
veOpenVPN0
arabirimleri arasındaki trafiğe izin vermek için şu komutu çalıştırın:no isolate-private
İstemciyi Internet'e de bağlamak için bu sunucuyu kullanmayı planlıyorsanız, şu komutu çalıştırın:
ip nat 10.1.0.2 255.255.255.255
ve ayarları şu komutla kaydedin:
system configuration save
Son olarak, OpenVPN bağlantısı için bir port açmak gerekir. Varsayılan bağlantı noktası
UDP / 1194
'tür. Bunu yapmak için, 'Sağlayıcı' arabirimi veya 'Güvenlik Duvarı' sayfasında Internet'e erişmek için kullanılan arabirim için bir kural oluşturun ('Sağlayıcıya ek olarak, PPPoE, L2TP veya PPTP arabirimleri olabilir).'Güvenlik duvarı kuralı' penceresinde, 'Eylem' alanında 'İzin Ver'i seçin; 'Protokol' alanında 'UDP' ve 'Hedef port numarası' alanında '
1194
'e eşit'.After creating the connection, set the switch to Enabled.
Bu, OpenVPN tünelinin yapılandırmasını tamamlar. Tünelin başarılı bir şekilde kurulduğu Sistem günlüğündeki mesajlarla ('Teşhis' sayfasındaki) kanıtlanabilir:
Kontrol etmek için tünelin her iki ucuna da ping atmayı deneyin:
ping 10.1.0.1 ping 10.1.0.2
ve sonra uzak alt ağlar:
ping 192.168.1.1 ping 192.168.2.1
Not
Sunucuya bağlı OpenVPN istemcileri, 'Kayıtlı olmayan cihazlar' listesindeki 'Cihaz listeleri' sayfasında görüntülenecektir. 'Kayıtlı olmayan cihazlar için bağlantı politikası' bölümündeki 'Giriş segmenti' sayfasında 'İnternet erişimi yok' politikasını seçtiyseniz, İnternet erişimi de sağlamanız gerekiyorsa OpenVPN istemcilerini kaydetmeyi unutmayın.
OpenVPN arayüzünün yapılandırması startup-config dosyasına kaydedilmez. Yedekleme amacıyla, OpenVPN ayarlarını ayrı bir dosyada yedeklemenizi öneririz.
[en] If the client connection OpenVPN needs to be used to access the Internet, assign this connection the highest priority. You will find information about priorities in the article "Connection priorities".
In some cases in the OpenVPN configuration it is necessary to specify login and password for authentication when connecting a VPN tunnel. To do this, a special
auth-user-pass
section must be added to the configuration file, specifying the login and password values. For example:<auth-user-pass> vpnclient # login r3d23xs87 # password </auth-user-pass>
An example of creating keys and certificates on Windows to connect to an OpenVPN server is shown in the article 'OpenVPN configuration using two-way TLS authentication'.
[en] Typical errors and solutions:
[en]
auth-user-pass without inline credentials data is not supported
[en] The configuration file contains a line for online login/password entry, which Keenetic does not support. Error in the Keenetic log file:
OpenVPN0 auth-user-pass without inline credentials data is not supported OpenVPN0 Exiting due to fatal error
[en] Delete or comment out all lines of this kind:
[en]
auth-user-pass
[en]
Block-outside-dns
option error[en] The
block-outside-dns
option is configured on the OpenVPN server, which is correctly handled only in Windows. Error in the Keenetic log file:OpenVPN0 Unrecognized option or missing or extra parameter(s) in configuration: (line X): block-outside-dns (2.4.4) OpenVPN0 Exiting due to fatal error
[en] Add a line to the OpenVPN client configuration file:
[en]
pull-filter ignore "block-outside-dns"
[en] Error when connecting to PrivateTunnel servers
[en] An error is displayed when trying to connect:
OpenVPN0 Unrecognized option or missing or extra parameter(s) in configuration: (line 3): client-ip (2.4.4)
[en] Add a line to the OpenVPN client configuration file:
[en]
ignore-unknown-option client-ip block-ipv6
[en] An error occurs when using the askpass
/storage/key.txt
option:Error: private key password verification failed
[en] This is a limitation of the current OpenVPN implementation in Keenetic. You can only use a key without a password or with a fixed password: '
password
'.[en] After updating the router to KeeneticOS
3.9.1
, the VPN tunnel to the OpenVPN servers for certain VPN suppliers may no longer be established. You can see the following messages in the system log:W [Dec 15 16:52:58] OpenVPN6: DEPRECATED OPTION: --cipher set to 'AES-128-CBC' but missing in --data-ciphers (AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305). OpenVPN ignores --cipher for cipher negotiations. Error: private key password verification failed
[en] The problem is the outdated encryption format BF-CBC, which is not supported starting from the OpenVPN
2.5.0
client version ( KeeneticOS3.9
uses the OpenVPN2.6.0
client version).Not
[en] The
BF-CBC
chipher is no longer supported in the default configuration. The OpenVPN2.5.0
version supportsAES-256-GCM
andAES-128-GCM
ciphers by default. You can change this behaviour using thedata-ciphers
option, for example, by specifying in the settingsdata-ciphers AES-256-GCM:AES-128-GCM:BF-CBC
. To support very old OpenVPN nodes that do not support cipher negotiation (mode "--cipher
"), you can specifydata-ciphers-fallback BF-CBC
.[en] When upgrading to a new version of OpenVPN, the setting "
cipher BF-CBC
" in older configuration files will be converted with appendingBF-CBC
to thedata-ciphers
set. In addition, thedata-ciphers-fallback
mode is turned on.[en] To successfully install the tunnel, you will need to change the directive:
[en]
cipher AES-128-CBC
todata-ciphers AES-128-CBC
ordata-ciphers AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305
[en] If it doesn't work, then change the directive:
[en]
cipher AES-128-CBC
todata-ciphers-fallback AES-128-CBC
[en] For maximum cipher negotiation compatibility with the remote server, specify the following directives:
[en]
data-ciphers AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305
[en]
data-ciphers-fallback AES-128-CBC
[en] or
[en]
data-ciphers AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305
[en]
data-ciphers-fallback AES-256-CBC
Önemli
[en] Encryption depends on the remote OpenVPN server. Before changing the directive
cipher
, please look at the system log.[en] If the following key size error is recorded in the log:
[E] Dec 16 19:01:38 OpenVPN0: Unrecognized option or missing or extra parameter(s) in configuration: (line 22): keysize (2.6_git) [E] Dec 16 19:01:38 OpenVPN0: Exiting due to fatal error [E] Dec 16 19:01:38 ndm: Service: "OpenVPN0": unexpectedly stopped.Error: private key password verification failed
[en] Then in the tunnel configuration, you need to remove the
keysize 256
option directive, which is outdated for the updated client OpenVPN2.6.0
, and check the tunnel connection again.[en] You can find detailed information for the "
keysize
" option by this link.
Aşağıdaki bilgileri okumanızı öneririz: