Split Tunneling in OpenVPN Client on Windows

The official OpenVPN client for Windows offers per-IP split tunneling. Some proprietary clients also offer per-app split tunneling.

To look up IP addresses, open a Windows terminal (Command Prompt or Windows PowerShell) and issue the command:

1
nslookup whatismyipaddress.com

Sample response:

1
2
3
4
Non-authoritative answer:
Name: whatismyipaddress.com
Addresses: 104.16.155.36
104.16.154.36

To send only two IP addresses through the VPN tunnel:

  1. Disconnect the client from the server
  2. Edit the client configuration file
  3. Add these lines at the end before reconnecting
1
2
3
4
5
6
route 104.16.154.36 255.255.255.255 vpn_gateway
route 104.16.155.36 255.255.255.255 vpn_gateway
route 0.0.0.0 192.0.0.0 net_gateway
route 64.0.0.0 192.0.0.0 net_gateway
route 128.0.0.0 192.0.0.0 net_gateway
route 192.0.0.0 192.0.0.0 net_gateway

To send everything except two IP addresses through the VPN tunnel:

1
2
route 104.16.154.36 255.255.255.255 net_gateway
route 104.16.155.36 255.255.255.255 net_gateway