Client Network List (CNL)
Last updated
Was this helpful?
Last updated
Was this helpful?
The VPN SDK allows you to configure client network lists (CNLs) to control when the VPN enables or disables based on the device's current network connection. This article explains how to set up client networks and utilize the CNL feature in your VPN app.
A client network list defines rules for enabling or disabling the VPN connection depending on the type of network the device is currently connected to. The supported network types are:
Wi-Fi
Wireless WAN (WWAN)
Local Area Network (LAN)
For each network type, you can specify an action to either enable or disable the VPN when the device connects to a network matching that type.
To configure client networks:
Sign in at .
Navigate to Settings -> VPN -> Client Networks, click on the Add button.
Edit the settings for the client network rule: - Select the network Type (Wi-Fi, WWAN, or LAN) - Choose the Action (enable or disable the VPN) For example:
Wifi
SSID: "MyHomeWifi"
BSSID: "00:11:22:33:44:55"
DIsable
Wifi
SSID: "PublicWifi"
BSSID: "00:14:22:01:23:45"
Enable
To utilize client network lists in your app, first enable the feature by setting isClientListEnabled
to true
in your ModulesConfiguration
:
The SDK will automatically fetch the configured CNL rules before enabling the VPN. You can access the retrieved rules through the `clientNetworkList` property on the `HydraSDK` instance:
The clientNetworkList
will contain an array of ClientNetworkRule
objects representing the matched rules for the current network.
When a matching CNL rule with the action: .disable
is found for the current network's SSID and BSSID, the VPN SDK will enter disable mode. In disable mode, the SDK automatically stops the VPN if it's running or prevents it from being enabled. Network traffic will go directly through the device's network connection without passing through the VPN.
This allows you to selectively disable the VPN on trusted networks.
The SDK provides a VPN Enabled
feature that allows for seamless VPN connectivity. When this feature is active, the SDK will automatically handle connecting or reconnecting to a VPN service using either the default
or last used
VPN profile or configuration.
Configure using :