Prevent IP Leaks
This module is used to block IPv6 and DNS requests outside the VPN tunnel.
What is a Prevent IP Leaks module
When developing VPN applications, it's crucial to ensure that users' IP addresses remain hidden and secure. IP leaks can expose users' real IP addresses, compromising their privacy and security. In this article, we'll explore how to prevent IP leaks using an SDK that provides IP leak prevention functionality.
An IP leak occurs when a VPN user's actual IP address is revealed, despite the active VPN connection. To minimize these risks, VPN applications must incorporate robust IP leak prevention mechanisms specifically designed for DNS and IPv6 traffic.
Default Windows DNS client sends DNS requests through the all network interfaces in the same time and waits which one will answer first. Even when you use Google DNS servers on your primary network adapter, they are located in different countries and the closest one will answer first and often it will be DNS server that is closest to your primary network interface, not a tunnel.
The same thing with IPv6 when VPN servers don't support IPv6. By default Windows prefers to use IPv6 over IPv4 and when sites have both IPv4 and IPv6 addresses then client machine will send traffic outside the tunnel.
Enabling Prevent IP Leaks
In our VPN SDK, the Prevent IP Leaks feature can be enabled in two ways:
By setting the
EnablePreventIPLeak
parameter:
When starting the VPN connection, set the
EnablePreventIPLeak
parameter to true in theStartVpnRequest
object:
By calling the
EnablePreventIpLeak/EnablePreventIpLeakAsync
methods:
Directly call the
EnablePreventIpLeak
orEnablePreventIpLeakAsync
method on the SDK instance:
Disabling Prevent IP Leaks module
To disable the Prevent IP Leaks feature, you can use one of the following methods:
By setting the EnablePreventIPLeak parameter:
When starting the VPN connection, set the
EnablePreventIPLeak
parameter to false in theStartVpnRequest
object:
By calling the DisablePreventIpLeak/DisablePreventIpLeakAsync method:
Directly call the
DisablePreventIpLeak
orDisablePreventIpLeakAsync
method on the SDK instance:
By following these steps, you can easily enable or disable the Prevent IP Leaks feature in our VPN SDK, ensuring the protection of users' IP addresses while connected to the VPN.
Last updated
Was this helpful?