Help Center/ Virtual Private Network/ Troubleshooting/ Client Connection Failures/ The Client Log Contains "Connection failed to establish within given time"
Updated on 2025-05-14 GMT+08:00

The Client Log Contains "Connection failed to establish within given time"

Applicable Client

Windows OpenVPN Connect

Symptom

A client cannot connect to a P2C VPN gateway, and the log contains the following error information:

Connection failed to establish within given time

Possible Causes

  • The client device cannot access the Internet.
  • After the server configuration is modified, the client configuration file is not downloaded again. As a result, the client configuration file in use is inconsistent with that on the Server tab page of the VPN gateway.

Procedure

  1. On the client device, try to access other Internet services.
    • If the access also fails, contact your carrier to rectify the network connectivity fault.
    • If the access is successful, go to step 2.
  2. Log in to the management console.
  3. Click in the upper left corner and select the desired region and project.
  4. Click in the upper left corner, and choose Networking > Virtual Private Network.
  5. In the navigation pane on the left, choose Virtual Private Network > Enterprise – VPN Gateways.
  6. Click the P2C VPN Gateways tab, locate the target VPN gateway, and click View Server in the Operation column.
  7. On the Server tab page, view the server ID in the Basic Information area, and view the server port and protocol in the Advanced Settings area.
  8. Check the proto and remote parameters in the client configuration file. An example is as follows:
    ...
    proto tcp    # Protocol type
    remote XXX.XX.XX.XX XXX     # Public IP address and port number of the server
    ...
    If the parameter settings in the client configuration file are inconsistent with the actual configuration of the server, use either of the following methods to rectify the fault:
    • Method 1: Modify the server information.
      1. On the Server tab page, modify the corresponding information.
      2. Download the new client configuration file.

        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.
    • Method 2: Modify the client configuration file.
      1. Open the client_config.ovpn file using Notepad or Notepad++.
      2. Modify the corresponding information in the client configuration file.
      3. Save the .ovpn configuration file.
  9. Start the OpenVPN Connect client.
  10. Import the new client configuration file.
  11. Use the client to reconnect to the VPN gateway.
  12. Press Win+R and enter cmd to open the command window.
  13. XX.XX.XX.XX indicates the private IP address of the ECS to be connected. Replace it with the actual private IP address.

    If information similar to the following is displayed, the client can communicate with the ECS:

    64 bytes from XX.XX.XX.XX: icmp_seq=1 ttl=63 time=1.27 ms
    64 bytes from XX.XX.XX.XX: icmp_seq=2 ttl=63 time=1.36 ms
    64 bytes from XX.XX.XX.XX: icmp_seq=3 ttl=63 time=1.40 ms
    64 bytes from XX.XX.XX.XX: icmp_seq=4 ttl=63 time=1.29 ms
    64 bytes from XX.XX.XX.XX: icmp_seq=5 ttl=63 time=1.35 ms
    64 bytes from XX.XX.XX.XX: icmp_seq=6 ttl=63 time=1.52 ms