Client Network List (CNL)
Last updated
Was this helpful?
Last updated
Was this helpful?
The Unified SDK allows you to automatically enable or disable VPN sessions based on network changes, such as when a user switches between Wi-Fi, mobile data, or other networks.
To set up this feature, follow these steps:
Sign in at pango-cloud.com.
Navigate to Settings -> VPN -> Client Networks, click on the Add button.
Edit the client network settings: Type (Wi-Fi, WWAN, LAN) and Action (enable/disable). Example configuration:
Wifi
SSID: "MyHomeWifi"
BSSID: "00:11:22:33:44:55"
Disable
Wifi
SSID: "PublicWifi"
BSSID: "00:14:22:01:23:45"
Enable
When the SDK enables the VPN for the first time, it downloads the necessary network configuration from the server. If there is no active VPN session, the SDK displays a notification based on the CNL settings.
You can customize the notification message shown to the user when the VPN is waiting for a secure network:
If you don't customize the notification, it will display the default title and message:
title
- CNL
message
- Waiting
When a device changes its network connection, the SDK will look through the configured networks in CNL and match the current configuration with server.
If the SSID and BSSID are empty, it will match any Wifi network.
If the authentication is set to Does not matter
, it will match both open and protected networks.
For Android 8.1+ (API 27) and Android 10+ (API 29), you need to set up and request runtime permission for location to match networks by SSID and/or BSSID.
If the required permission is missing, the SDK will not be able to access the network SSID and BSSID.
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.
The CNL configuration can also be managed on the client side.
When a user changes the network while a VPN session is active and the new network matches the CNL rules with the Disabled
action, the SDK will not reconnect to this network. Instead, it will throw a CnlBlockedException
in the VpnStateListener#vpnError
callback. Below is an example message: