Openvpn 構成ファイルは CLI では機能しますが、ネットワーク マネージャーでは機能しません。

Openvpn 構成ファイルは CLI では機能しますが、ネットワーク マネージャーでは機能しません。

私はリモートVPSに独自のopenvpnサーバーをインストールしましたopenvpn-install ユーティリティすべてのデフォルトパラメータを取得します。

出力 .ovpn ファイルをクライアント マシンにダウンロードした後、CLI から openvpn サーバーをテストすると、正常に動作します。

sudo openvpn vpnperso.ovpn

しかし、ネットワーク マネージャーでこのファイルをインポートしようとすると、VPN への接続がタイムアウトします。

クライアント側のログ:

$cat /var/log/syslog | grep vpn

juin 30 10:58:09 sainte-victoire NetworkManager[774]: <info>  [1561885089.8474] audit: op="connection-activate" uuid="1c4eaa3c-a511-4e0d-b115-ced19c047574" name="vpnperso" pid=1281 uid=1000 result="success"
juin 30 10:58:09 sainte-victoire NetworkManager[774]: <info>  [1561885089.8538] vpn-connection[0x562bf20367c0,1c4eaa3c-a511-4e0d-b115-ced19c047574,"vpnperso",0]: Started the VPN service, PID 31822
juin 30 10:58:09 sainte-victoire NetworkManager[774]: <info>  [1561885089.8634] vpn-connection[0x562bf20367c0,1c4eaa3c-a511-4e0d-b115-ced19c047574,"vpnperso",0]: Saw the service appear; activating connection
juin 30 10:58:09 sainte-victoire NetworkManager[774]: <info>  [1561885089.8698] vpn-connection[0x562bf20367c0,1c4eaa3c-a511-4e0d-b115-ced19c047574,"vpnperso",0]: VPN plugin: state changed: starting (3)
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: WARNING: file '/home/luc/.local/share/networkmanagement/certificates/vpnperso/private.key' is group or others accessible
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: OpenVPN 2.4.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on May 14 2019
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: library versions: OpenSSL 1.1.1  11 Sep 2018, LZO 2.08
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: TCP/UDP: Preserving recently used remote address: [AF_INET]ip.ip.ip.ip:1194
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: UDP link local: (not bound)
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: UDP link remote: [AF_INET]ip.ip.ip.ip:1194
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: NOTE: chroot will be delayed because of --client, --pull, or --up-delay
juin 30 10:58:09 sainte-victoire nm-openvpn[31825]: NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay
juin 30 10:59:09 sainte-victoire NetworkManager[774]: <warn>  [1561885149.6776] vpn-connection[0x562bf20367c0,1c4eaa3c-a511-4e0d-b115-ced19c047574,"vpnperso",0]: VPN connection: connect timeout exceeded.
juin 30 10:59:09 sainte-victoire nm-openvpn-serv[31822]: Connect timer expired, disconnecting.
juin 30 10:59:09 sainte-victoire nm-openvpn[31825]: TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
juin 30 10:59:09 sainte-victoire nm-openvpn[31825]: TLS Error: TLS handshake failed
juin 30 10:59:09 sainte-victoire nm-openvpn[31825]: SIGTERM[hard,tls-error] received, process exiting
juin 30 10:59:09 sainte-victoire NetworkManager[774]: <warn>  [1561885149.6875] vpn-connection[0x562bf20367c0,1c4eaa3c-a511-4e0d-b115-ced19c047574,"vpnperso",0]: VPN plugin: failed: connect-failed (1)
juin 30 10:59:09 sainte-victoire NetworkManager[774]: <info>  [1561885149.6884] vpn-connection[0x562bf20367c0,1c4eaa3c-a511-4e0d-b115-ced19c047574,"vpnperso",0]: VPN plugin: state changed: stopping (5)
juin 30 10:59:09 sainte-victoire NetworkManager[774]: <info>  [1561885149.6892] vpn-connection[0x562bf20367c0,1c4eaa3c-a511-4e0d-b115-ced19c047574,"vpnperso",0]: VPN plugin: state changed: stopped (6)

サーバー側ログ

$cat /var/log/syslog | grep vpn

Jun 30 10:59:09 vps704584 ovpn-server[12227]: TLS Error: tls-crypt unwrapping failed from [AF_INET]ip:ip:ip:ip:53903
Jun 30 10:59:09 vps704584 ovpn-server[12227]: tls-crypt unwrap error: packet too short

NetworkManager を動作させるにはどうすればよいですか?

答え1

問題は、NetworkManager が現在tls-cryptopenvpn バージョン 2.4 以降の機能をサポートしていないことです。

https://github.com/angristan/openvpn-install/issues/312

デフォルトでは、openvpn インストールインストール中は、有効になっている最高のセキュリティ設定が適用されますtls-crypt。ネットワークマネージャを OpenVPN サーバーで動作させたい場合は、サーバーに OpenVPN をインストールするときにこの機能を無効にする必要があります。同じスクリプトを使用して OpenVPN をアンインストールし、再インストールして、インストール手順中に暗号化のカスタム設定を使用できます。ある時点で、またはをopenvpn-install.sh使用するように求められます。を選択します。tls-authtls-crypttls-auth

tls-auth と tls-crypt の違い

関連情報