This feature is embedded in our Windows VPN client software, starting with version 3.0
For security and privacy reasons, it's utterly important to know when VPN connection drops and stop traffic leakage via ISP, especially when you leave your PC unattended.
To overcome this risk, we created a batch script for Windows that will protect against IP leakage once VPN connection drops.
- Disable DHCP and use a static IP address, otherwise the DHCP service may re-add the gateway which was previously removed by the script.
- This doesn't protect against DNS leaks. IP leaking and DNS leaking are different issues.
Download the script here: zip
If you select the txt version, save it to a local file with .bat extension.
- the script will allow you to easily remove or restore your default gateway
- it requires administrator privileges but we use a workaround so you don't need to use right click > Run as administrator
- it works on all Windows releases
- it detects the default gateway IP. We suggest to edit the script and add your default gateway as fall-back, in case it can't be detected
- it works with all VPN protocols and all VPN connection methods - either 3rd party software such as our Windows VPN Client, OpenVPN GUI or Windows built-in dialers
- Once connected to the VPN, run the script and remove the default gateway (Choice 1)
- When VPN disconnects, close all programs that may leak your IP and restore the gateway with the script (Choice 2)
- You can leave the script running/minimized for quick access when needed and just cycle through Choice 1 and 2 upon VPN connect/disconnect
- The gateway removal is not persistent, so it will be restored on PC restart or disabling/enabling the Network Interface
NOTE: the script was tested by our staff on many Windows releases and scenarios and it worked fine. But it is still in BETA stage so please get in touch with us if you face any problems.