Routes unable to be added Win 10

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
tmaxxcar
OpenVpn Newbie
Posts: 4
Joined: Sun May 14, 2017 1:54 am

Routes unable to be added Win 10

Post by tmaxxcar » Sun May 14, 2017 2:24 am

Iv'e been at this for quite some time now, and I have finally gotten the client/server to the point where I can connect and have local access. It appears the same issue is plaguing the client and server. I have already tried running as administrator, and completely shutting down any/all services related to OpenVPN and then running as administrator only, however I still receive the following errors:

Server Log
Sat May 13 22:00:37 2017 NOTE: FlushIpNetTable failed on interface [17] {D5328A48-D780-43B7-B63A-E798C8428EC3} (status=5) : Access is denied.
Note: The server error also shows up in the client log, just before the do_ifconfig.
Client Log
Sat May 13 21:56:27 2017 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Sat May 13 21:56:36 2017 TEST ROUTES: 4/4 succeeded len=3 ret=1 a=0 u/d=up
Sat May 13 21:56:36 2017 C:\WINDOWS\system32\route.exe ADD x.x.x.x MASK x.x.x.x x.x.x.x
Sat May 13 21:56:36 2017 ROUTE: route addition failed using CreateIpForwardEntry: Access is denied. [status=5 if_index=15]
Sat May 13 21:56:36 2017 Route addition via IPAPI failed [adaptive]
Sat May 13 21:56:36 2017 Route addition fallback to route.exe
Sat May 13 21:56:36 2017 env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Sat May 13 21:56:36 2017 ERROR: Windows route add command failed [adaptive]: returned error code 1
Sat May 13 21:56:36 2017 C:\WINDOWS\system32\route.exe ADD x.x.x.x MASK x.x.x.x x.x.x.x
Sat May 13 21:56:36 2017 ROUTE: route addition failed using CreateIpForwardEntry: Access is denied. [status=5 if_index=2]
Sat May 13 21:56:36 2017 Route addition via IPAPI failed [adaptive]
Sat May 13 21:56:36 2017 Route addition fallback to route.exe
Sat May 13 21:56:36 2017 env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Sat May 13 21:56:36 2017 ERROR: Windows route add command failed [adaptive]: returned error code 1
Sat May 13 21:56:36 2017 Initialization Sequence Completed

Any ideas on how to proceed is greatly appreciated.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Routes unable to be added Win 10

Post by TinCanTech » Sun May 14, 2017 10:05 am

If you use openvpn-2.4 you do not need to run as admin ..

tmaxxcar
OpenVpn Newbie
Posts: 4
Joined: Sun May 14, 2017 1:54 am

Re: Routes unable to be added Win 10

Post by tmaxxcar » Sun May 14, 2017 6:07 pm

My apologies if I was not clear enough in my initial post, however I have tried running without administrative privileges and with, neither of which solves the routing issue.

My question really boils down to: How can I add these routes at run-time of the client connection?

I could manually add these routes into the client pc, however I feel that this may cause more issues than it solves as this would be a permanent change.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Routes unable to be added Win 10

Post by TinCanTech » Sun May 14, 2017 7:49 pm

My apologies if I was not clear enough in my initial answer.

Here is a more clear one

Please see:
HOWTO: Request Help !

tmaxxcar
OpenVpn Newbie
Posts: 4
Joined: Sun May 14, 2017 1:54 am

Re: Routes unable to be added Win 10

Post by tmaxxcar » Sun May 14, 2017 11:02 pm

Ok...
This sample is from another client config that I have (and have used for quite some time now) and have used it across Windows 8, 8.1, and Windows 10.
When connecting from Windows 8 & 8.1, I am able to connect and route my web traffic to the server.
When connecting from Windows 10, I get the error message at the end of the post.
OpenVPN Version
OpenVPN 2.4.2 x86_64-w64-mingw32
Client
dev tun
tls-client
remote x xxxx
redirect-gateway def1
dhcp-option DNS x.x.x.x
pull

route-method exe
route-delay 2
Skipped adding in security cipher, auth etc.

Also important to note that in reference to this post on serverfault, I tried to add the route-method exe and a delay to see if that would allow the modification of my Route.exe file. Unfortunately, I still receive the same type of error although it is a little cleaner.
Client Error
Sun May 14 18:40:18 2017 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Sun May 14 18:40:20 2017 env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Sun May 14 18:40:21 2017 ERROR: Windows route add command failed: returned error code 1
Sun May 14 18:40:21 2017 env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Sun May 14 18:40:21 2017 ERROR: Windows route add command failed: returned error code 1
Sun May 14 18:40:21 2017 env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Sun May 14 18:40:21 2017 ERROR: Windows route add command failed: returned error code 1
Sun May 14 18:40:21 2017 env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Sun May 14 18:40:21 2017 ERROR: Windows route add command failed: returned error code 1
Sun May 14 18:40:21 2017 env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Sun May 14 18:40:21 2017 ERROR: Windows route add command failed: returned error code 1
Sun May 14 18:40:21 2017 env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Sun May 14 18:40:21 2017 ERROR: Windows route add command failed: returned error code 1
Sun May 14 18:40:21 2017 Initialization Sequence Completed
No matter how I start OpenVPN on the Win 10 system, I get the same routing error.

Ok, as I was typing this I believe I came across somewhat of an answer:

I somehow managed to come across OpenVPN Ticket #68.

In reading comment #11, zerok0ol was able to connect when running ovpn from an elevated command prompt. When I did the same, I got the following output:
Client Output from Elevated Command Prompt
Sun May 14 18:47:49 2017 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Sun May 14 18:47:51 2017 env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Sun May 14 18:47:51 2017 env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Sun May 14 18:47:51 2017 env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Sun May 14 18:47:51 2017 env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Sun May 14 18:47:51 2017 env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Sun May 14 18:47:51 2017 env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
Sun May 14 18:47:51 2017 Initialization Sequence Completed
So it looks like it works, but I am trying to install for a user who would not see using an elevated command prompt/running a batch script as a solution. Also, it doesn't connect with the GUI and inform the user with a message box that the connection has been established/severed etc.

Maybe the above issue needs to be reopened.

tmaxxcar
OpenVpn Newbie
Posts: 4
Joined: Sun May 14, 2017 1:54 am

Re: Routes unable to be added Win 10

Post by tmaxxcar » Sun May 14, 2017 11:12 pm

I spoke too soon. I disconnected from my elevated command prompt and attempted to use the GUI. My new error is that route.exe was unable to add the routes listed because they already exist.

Maybe by running the elevated command prompt, I forced the routes into route.exe, and they are now persistent?
To be honest, I don't know much about route.exe.

If the routes are persistent then could it cause any issues when using the VPN, or when not using the VPN?

Post Reply