• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3624
  • Last Modified:

How to add route to OpenVPN automatically?

Hi Experts,

I have a fully functional OpenVPN setup, but can't figure out how to add a route on a Windows 7 64bit workstation.

The route adds well on a Windows XP workstation - there's a route.exe file and "up" file that has the actual route information (route add 192.168.1.0 mask 255.255.255.0 172.1.1.1). It works for XP, but for Win 7 complaints that the route.exe is not a 64bit application, and is not compatible.

How would I add a route to Win7 64bit automatically?

Thanks in advance!
0
Kaptain1
Asked:
Kaptain1
  • 3
  • 2
1 Solution
 
Kaptain1Author Commented:
Great! Thank you.

Could you please let me know how I can add multiple routes to the OpenVPN?

I tried adding several of them, but only the last one actually goes through.

route-up "route add 192.168.1.0 mask 255.255.255.0 172.88.88.1"
route-up "route add 192.168.2.0 mask 255.255.255.0 172.88.88.1"
route-up "route add 192.168.3.0 mask 255.255.255.0 172.88.88.1"

Thank You!
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
You usually do not use route-up, unless you need to run scripts for dynamic routing or the like. In your case, you should either push the routes in the server config:
push "route 192.168.1.0 255.255.255.0"
push "route 192.168.2.0 255.255.255.0"
push "route 192.168.3.0 255.255.255.0"

Open in new window

or use the corresponding commands in the client config:
route 192.168.1.0 255.255.255.0
route 192.168.2.0 255.255.255.0
route 192.168.3.0 255.255.255.0

Open in new window

Any reason why you don't just route 192.168.0.0/22 (255.255.252.0)?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Kaptain1Author Commented:
Thanks.

I'm using MikroTik router as an OpenVPN servers, and it seems that it may not allow "pushing" the route to clients. The only way that I know of is to include the routes in Client's config, which is what i'm doing.

So, I need these commands to work with Windows/cmd... It doesn't look like "route or push" would work in CMD. :)

I can't use /22 because it would include the networks from which the Clint may be connecting from... (the ips of my remote network is actually 192.168.32.0, 33.0, etc).

Thank You.
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
For client config see the second part of my post - just insert that into the client config file.
0
 
Kaptain1Author Commented:
Thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now