Archive

Archive for the ‘network’ Category

OpenVPN and hosts/routes in your local/corporate networks

February 21, 2011 Leave a comment

Using the most excellent OpenVPN (seriously, it blows anything I ever used for VPNs out of the water…) and wondering how to not tunnel local networks, aka how to access local network hosts and routes? Simply use the following most common options in your client-configuration.

route net_gateway <network> <netmask>, e.g. route 10.65.0.0 255.255.0.0 net_gateway
A statement like this will route anything that goes to that network through your original network-adapter/gateway and not through the tunnel.

There is one common pitfall though… Usually your local/corporate networks use their own DNS servers for local/company-specific needs. No problem, simply override the DNS pushed from your OpenVPN provider:
dhcp-option DNS <host>, e.g. dhcp-option DNS 10.65.1.1
You can have multiple DNS servers defined, just add more dhcp-option statements.

There are lots more options (see the OpenVPN manpage), but these should cover most needs.

Categories: network Tags: , ,
%d bloggers like this: