Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got OpenVPN client running on What I'd like to do is route all the traffic from the second computer with via OpenVPN client that's running on the first computer. My router ip is

Network topology:

Computer with OpenVPN client:
Computer that has to be rerouted:

I want it to work in the following way: computer => computer => OpenVPN =>

How can I achieve that by only modifying windows' routing table? I've tried the following, which didn't work (it just dropped my internet connection):

route delete mask
route add mask


share|improve this question

migrated from Mar 26 '12 at 17:12

This question came from our site for professional and enthusiast programmers.

Don't forget to include details like the OS and version of each machine involved. – Christopher Cashell Mar 26 '12 at 23:04
You're correct, I'm on Windows. – Ilya Suzdalnitski Mar 27 '12 at 1:12

This is a quick one. Add to your .ovpn client file:

redirect-gateway def1

Also make sure you have IP-Forwarding activated on the server and depending on your Windows Version you might have to set route-method too. Normally this uses the NAPI, but sometimes wants to be set to:

   route-methode exe
   route-delay 2

Try without this first.

EDIT: Aaaah, you want to redirect another computer via the OpenVPN Client. For this to work you need Internet Connection Sharing Services on Windows. Check out

share|improve this answer

You need to make use as its default route instead of (or configure to route packets from to Then you need to route packets for other hosts (I don't know how one does this in Windows). Lastly, you need to tell the OpenVPN server that the subnet is routable through so that response packets get back. You need a route directive in the server's configuration file, as well as an iroute directive in the CCD configuration file for (see this page for more details). (You could also get to NAT packets for to avoid this last step.)

share|improve this answer
I'm a total newbie in this, can you please give me exact commands to route the traffic? Will entering this command on the computer without OpenVPN work: "route add mask metric 1"? How do I route packets for other hosts on Windows? Can you give me example config for OpenVPN? – Ilya Suzdalnitski Mar 27 '12 at 1:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.