Windows – Routing all Traffic through OpenVPN Tunnel

networkingopenvpnroutingtunnelwindows 7

I have installed OpenVPN server on Archlinux and am now using OpenVPN GUI on Windows 7, I can talk to other computers connected through the VPN but I have not yet figured out how to route all traffic through the tunnel.

How do I do this? I figured I need to do it with route ( cmd command ) but I think i need some pointers here.

I've followed the OpenVPN HowTo on the matter but that doesn't work, it simply doesn't push the "force the client to go through this gateway"-option.

And changing from OpenVPN to a PPTP / IPSec alternative is not an option at the moment.

Best Answer

Set the VPN Interface as your def gateway (making sure it's up)...

In Linux this would be something along the lines of (of a.b.c.d is the address of your VPN interface):

sudo ip route replace 0.0.0.0/0 via a.b.c.d

Or you can use "/sbin/route" but the syntax is slightly different.

If you want this to persist through reboots you can add it to /etc/rc.local but you probably want to use the specific method for your distribution. I see you are using Arch Linux so the file you want to edit for a permanent static route added at boot is /etc/rc.conf. Check here for more info.

Good Luck!

=====================

I just wrote this answer and then re-read the question....

For Windows you want to do this (on a command line):

route add 0.0.0.0 mask 0.0.0.0 a.b.c.d

or possibly:

route change 0.0.0.0 mask 0.0.0.0 a.b.c.d

Related Question