Updated on 2025-05-14 GMT+08:00

Configuring a Windows Client

Version Requirements

Table 1 lists the client versions supported by Windows.
Table 1 Version requirements

Client Type

OpenVPN Version

Operation Guide

OpenVPN GUI

2.6 or later

OpenVPN GUI

OpenVPN Connect

3.4.4 or later

OpenVPN Connect

OpenVPN GUI

  1. Download the OpenVPN GUI installation package and install it as prompted.

    The installation package varies according to the Windows operating system as follows:

  2. Download the client configuration file.

    1. Log in to the management console.
    2. Click in the upper left corner and select the desired region and project.
    3. Click in the upper left corner, and choose Networking > Virtual Private Network.
    4. In the navigation pane on the left, choose Virtual Private Network > Enterprise – VPN Gateways.
    5. Click the P2C VPN Gateways tab, and click Download Client Configuration in the Operation column of the target VPN gateway.

      The downloaded client configuration file is client_config.zip.

  3. Decompress client_config.zip to a specified directory, for example, D:\.

    After the decompression, the client_config.ovpn and client_config.conf files are generated.

  4. Open the client_config.ovpn file using Notepad or Notepad++.
  5. Add the client certificate and private key to the file.

    Enter the client certificate content and the corresponding private key in between <cert></cert> and <key></key> tags, respectively.
    <cert>
    -----BEGIN CERTIFICATE-----
    Client certificate content
    -----END CERTIFICATE-----
    </cert>
    
    <key>
    -----BEGIN PRIVATE KEY-----
    Client private key
    -----END PRIVATE KEY-----
    </key>

  6. Save the .ovpn configuration file.
  7. Click OpenVPN GUI in the Start menu to start the client.

    The message "OpenVPN GUI is already running. Right click on the tray icon to start." is displayed in the lower right corner.

  8. Right-click the icon on the Windows taskbar, and choose Import > Import file.

    Import the .ovpn configuration file.

    When the message "File imported successfully." is displayed in the lower right corner, the file is imported.

  9. In the Open dialog box, select the configuration file with the client certificate and private key added, and click Open.
  10. Right-click the icon on the Windows taskbar, and choose Connect.

OpenVPN Connect

  1. Download OpenVPN Connect from the OpenVPN official website, and install it as prompted.
  2. Download the client configuration file.

    1. Log in to the management console.
    2. Click in the upper left corner and select the desired region and project.
    3. Click in the upper left corner, and choose Networking > Virtual Private Network.
    4. In the navigation pane on the left, choose Virtual Private Network > Enterprise – VPN Gateways.
    5. Click the P2C VPN Gateways tab, and click Download Client Configuration in the Operation column of the target VPN gateway.

      The downloaded client configuration file is client_config.zip.

  3. Add configuration information.

    You can add configuration information using either of the following methods:
    • Method 1: Import the configuration file (with the client certificate and private key added).
      1. Decompress client_config.zip to a specified directory, for example, D:\.

        After the decompression, the client_config.ovpn and client_config.conf files are generated.

      2. Open the client_config.ovpn file using Notepad or Notepad++.
      3. Add the client certificate and private key to the file.
        Enter the client certificate content and the corresponding private key in between <cert></cert> and <key></key> tags, respectively.
        <cert>
        -----BEGIN CERTIFICATE-----
        Client certificate content
        -----END CERTIFICATE-----
        </cert>
        
        <key>
        -----BEGIN PRIVATE KEY-----
        Client private key
        -----END PRIVATE KEY-----
        </key>
      4. Save the .ovpn configuration file.
      5. Start the OpenVPN Connect client.
      6. Import the .ovpn configuration file.
    • Method 2: Use the original configuration file (without the client certificate and private key) and a USB key.
      1. Initialize a USB key.

        The following uses Longmai's mToken GM3000 administrator tool (v2.2.19.619) as an example to describe how to create a USB key. When the USB key is successfully initialized, remove and insert the USB key.

      2. Import the client certificate to the USB key.

      3. Use the USB key to establish a VPN connection.

        In OpenVPN Connect, import the configuration file without the client CA certificate and private key from the USB key, and click CONNECT.

      • When the connection is being established, do not remove the USB key.
      • After the connection is established, it will not be interrupted if you remove the USB key, and you can tear down this connection manually. However, the connection will fail to be re-established after you remove the USB key.

  4. Establish a VPN connection.

    If information similar to the following is displayed, the connection is successfully established.
    Figure 1 Connection established