Is it possible to keep VPN connected but route traffic through the VPN only when requested?

40 views
Skip to first unread message

pyram...@gmail.com

unread,
Aug 11, 2017, 5:10:46 PM8/11/17
to tunnelblick-discuss
I'm using VPN to circumvent bans. My country of residence bans Wikipedia. I don't want to use VPN all the time. When Ineed to visit a Wikipedia link, I select "connect" and the whole authorization / Getting configuration step takes 10 seconds which becomes a burden. I just want to connect once, and keep connected to the VPN server but want to toggle traffic routing which shouldn't take any time - just a config change on my machine right?

So is there any way to keep the VPN connection active but route traffic through it only when requested?

Tunnelblick developer

unread,
Aug 12, 2017, 6:18:55 AM8/12/17
to tunnelblick-discuss
This isn't something that I want to add to Tunnelblick. 

You could do it outside of Tunnelblick but it will require a lot of work and will use routing commands which must be done by root.
  • In the OpenVPN configuration file (and the pushes from the server): do not use "redirect-gateway".
  • Un-check Tunnelblick's "Route all IPv4 traffic through the VPN" checkbox.
This configuration will be a VPN that routes only traffic destined for the VPN through the VPN. That's your "normal" mode of operation (when you are not accessing Wikipedia).

When you want to access Wikipedia, you need to add routing that routes everything through the VPN. You could do that with routing commands similar to the ones that OpenVPN uses to implement "redirect-gateway". The hard part of that is to ascertain the address of the VPN server. That could be done in a custom "up" script which stores that IP address where your "send everything through the VPN" and "stop sending everything through the VPN" scripts could access it.
Reply all
Reply to author
Forward
0 new messages