Master the Command Line: A Guide to Using WireSock VPN Client CLI
The WireSock VPN Client offers a command-line interface (CLI) for Windows, which can be accessed through
wiresock-client.exe. This application can either be run as a console application or as a Windows service.
When you execute
wiresock-client.exe without any parameters, you’ll see the following usage information:
WireSock WireGuard VPN Client Version 1.2.32 Build 1 Usage: install Installs the service with the specified configuration. Options: -start-type <2..4> Service start type: 2 - Automatic start on system startup. 3 - Manual start. 4 - Disabled state; must be enabled before starting. -account <name> Account name under which the service will run. -password <password> Password for the account. -config <path> Full path to the WireGuard client configuration. -fallback-config <path> Full path to the fallback WireGuard client configuration (optional). -log-level <level> Logging level: none, info, debug, or all. -lac Spawn Virtual Network Interface associated with the tunnel (optional). Example: install -start-type 2 -account User -password Pass -config "path\to\config.conf" -log-level info run Starts the WireSock VPN Client as a regular process (not as a service). Accepts the same options as 'install', without the start type, account, and password. Example: run -config "path\to\config.conf" -log-level info uninstall Removes the installed service. import <wireguard-client-config-full-pathname> [-account <name> -password <password>] Encrypts the specified WireGuard client configuration and places it in a protected folder. If -account and -password are specified, the configuration is accessible under the given user account. Otherwise, it is only accessible when running as a Windows Service under the LocalSystem account. Example: import "path\to\config.conf" import "path\to\config.conf" -account User -password Pass Note: Replace <path\to\config.conf> with the actual full path to your WireGuard client configuration file. Use double quotes if the path contains spaces, e.g., "C:\path to\config.conf".
If you have your WireGuard configuration file ready, you can swiftly initiate the WireSock VPN Client as a standalone application with the following command:
wiresock-client.exe run -config [config_full_path_name] -log-level none
[config_full_path_name] with the actual path to your WireGuard configuration file to connect seamlessly.
For scenarios where you require the WireSock VPN Client to operate in virtual network interface mode, execute this command instead:
wiresock-client.exe run -config [config_full_path_name] -log-level none -lac
A key point to remember is to employ the
-log-level none parameter for routine operations to optimize performance. Reserve the use of logging levels other than ‘none’ for times when you need to troubleshoot or debug the application, as extensive logging can impact the application’s efficiency.
Here’s a more structured and user-friendly version of the instructions for installing and managing the WireSock VPN Client Service:
Installing WireSock VPN Client as a Windows Service
To set up the WireSock VPN Client to automatically start with Windows, use the following command:
wiresock-client.exe install -start-type 2 -config [config_full_path_name] -log-level none
Ensure you replace
[config_full_path_name] with the actual path to your WireGuard configuration file.
For Virtual Network Adapter Mode
If you need to install the client with a virtual network adapter, append the
wiresock-client.exe install -start-type 2 -config [config_full_path_name] -log-level none -lac
Managing the Service
Starting and Stopping the Service:
You can control the WireSock VPN Client Service via the Windows Services interface or with administrative command-line instructions:
- To start the service:
sc start wiresock-client-service
- To stop the service:
sc stop wiresock-client-service
Before uninstalling the service, make sure it is stopped. Then, you can remove the service using one of the following methods:
- With the WireSock client command:
- Or directly through the command line:
sc delete wiresock-client-service
Remember to execute these commands with Administrator privileges.
Here’s an enhanced explanation of the differences between running WireSock VPN Client in application mode versus service mode:
Choosing Between Application and Service Modes for WireSock VPN Client
Running WireSock VPN Client as a regular application is straightforward and suitable for most users. However, it’s important to note that in this mode, the VPN client will only manage network routing for processes initiated by the user currently logged in. Any system-level processes or those started by other users will not be affected and will continue to use the default network interface.
Alternatively, installing WireSock VPN Client as a Windows service allows it to operate at the system level. This means it can manage network routing for all processes on the system, regardless of which user started them. This mode is particularly useful if you require VPN connectivity across multiple user accounts or for services running in the background.
- In Application Mode, the VPN client’s split tunneling feature is limited to the current user’s processes.
- In Service Mode, the VPN client has the capability to handle split tunneling for all processes, providing a more comprehensive coverage.
Choose the mode that best fits your use case for the most efficient VPN experience with WireSock.