12) Open Tunnelblick by double-clicking on its icon (from the Applications folder). 13) Select the configuration you have added (left column), then click on 'Settings'. 14) In the settings window, check the box 'Route all IPv4 traffic through the VPN', then you can close the Tunnelblick window. This assumes, I only want to access resources from the VPN in the 192.168.2.XXX ip-range. But it still allows me to access the internet and all other resources (as the VPN in my example only allows access to certain resources, but not the internet). This also assumes, the VPN (in my case Tunnelblick) uses tap0 as the network adapter.
Force all traffic through OpenVPN connection
This is a really quick one, as we use this trick a lot when working remotely, but we always have to scrabble around to find the info!
We use the open source OpenVPN for our office VPN. In general it’s great, however when working away from the office, it’s configured such that any request for a resource first checks outside of the firewall to see if it can access it. If it can, it does, no VPN involved. If it can’t, it then tries inside the VPN tunnel.
For example, with the VPN connected, if I try to go to http://blog.sellorm.com
, access occurs out side of the VPN as the resource is on the open internet. If I try to access something like http://rstudio.office.local
, that isn’t on the open internet, access takes place through the VPN. This is a really great way of reducing traffic through the VPN to include only access to essential resources. We know this isn’t the most secure option, but it works for us for the moment.
There is one interesting exception to this however, and that is systems on public cloud providers like Amazon’s AWS. These systems are by necessity available on the public internet, but we generally use firewalls to only permit access from the office.
Unfortunately, this breaks the configuration above because as the hostname of the resource can be looked up on the open internet, the client thinks it should be able to access it outside of the VPN. As access is not permitted outside of the office though, this request will eventually fail. This means that we need to temporarily push all traffic through the VPN while we work with that AWS resource.
As a Mac user, using the excellent TunnelBlick OpenVPN client, this is easy for me, as they helpfully provide a ‘Route all IPv4 traffic through the VPN’ tick box. For my Windows using colleagues however, it’s not quite so simple. They must edit their OpenVPN config file and manual add the following line to the end, before restarting their VPN connection.
This file is often just called client.ovpn.
Hopefully this quick post make this easier to find for me next time someone asks about it as well as helping someone else facing the same issue in the future.
Tunnelblick All Traffic Through Vpn Free
Highlighted Articles Discussion Group | On This Page Troubleshooting this problem could be very simple: try connecting the VPN with and without 'Set nameserver' selected. If one way or the other solves your problem, you're done! OpenVPN is such a powerful tool with so many options, and computer configurations are so varied, that it is impossible to have an exhaustive troubleshooting guide. This guide is meant for the most common setups, so if it doesn't apply to your situation, or doesn't help, see the Support page for guidance. This page assumes that you are successfully connected to a VPN server. If not, or if you aren't sure, look at Common Problems. If OpenVPN is connected to the server but you can't access the InternetAfter connecting, if you can't reach the Internet, it's likely that your setup has
Tunnelblick includes the ability to diagnose some DNS problems and will warn you about some common configuration problems. Check for a DNS problem: If you don't have a DNS problem then there is something else going on. See the Support page for guidance. If you have a DNS problem:
How to check your DNS settings
Note: If the DNS server list is dimmed (grayed out), it was set via DHCP, not manually. How to use a different DNS serverThere are two ways to set up a different DNS server: Use a different DNS server whether or not a VPN is activeYou can set your computer up to use a different DNS server all the time. Google Public DNS is free, and OpenDNS has a free version. There are lots of others. To use such a DNS server all the time (whether or not a VPN is connected):
This will set up your computer to always (whether or not you are connected to the VPN) use two Google DNS servers and two OpenDNS servers (in that order). Substitute the addresses for the DNS provider of your choice if you want. Use a different DNS server only when the VPN is activeNote: This will only work if you specify 'Set nameserver' in Tunnelblick's settings for the configuration. Add a line to your OpenVPN configuration file for each DNS server: ' If OpenVPN is connected to the server but your IP address does not changeIf you have a check in the 'Check if the apparent public IP address changed after connecting' checkbox on the 'Settings' tab of Tunnelblick's 'VPN Details' window, and your IP address doesn't change after connecting, a window will pop up to notify you. If OpenVPN connects to the server properly but your IP address does not change, your OpenVPN setup needs to include the '--redirect-gateway' option. By default, OpenVPN only sends some traffic through the VPN — traffic that is specifically destined for the VPN network itself. The '--redirect-gateway' option tells OpenVPN to send all IPv4 traffic through the VPN. There are three ways the option can be added; you need only use one:
(The '--' at the start of an OpenVPN option is omitted when the option appears in a configuration file.) How to test your IP addressYou can find out what IP address your computer is using by going to https://tunnelblick.net/ipinfo. The first number shown is your apparent public IP address: Note: tunnelblick.net does not use Javascript, other client-side scripting, plugins, trackers, beacons, or web bugs, and it does not carry advertising. It does not store cookies or any other data on your computer (except as noted in the tunnelblick.net privacy policy). If you have checked 'Check if the apparent public IP address changed after connecting', the IP address will be displayed in the Tunnelblick menu while you are connected: |