300000 wrote
you can phone paid to microsoft helpline so they can help you , that is how windows works not openvpn , nothing to do with openvpn at all.
While I agree that installing and running the OpenVPN daemon has "
nothing to do with openvpn at all", I was hoping someone has solved this very common problem via either an option to the openvpn.exe daemon perhaps, or some other option so that the route command executed by openvpn would succeed without the need to run as administrator.
The problem boils down to how the openvpn daemon sets the route, as shown in this "good" log and "bad" log:
Good log:
2020-08-23 15:03:14 TEST ROUTES: 1/1 succeeded len=0 ret=1 a=0 u/d=up
2020-08-23 15:03:14 C:\Windows\system32\route.exe ADD xxx.xxx.xxx.xxx MASK 255.255.255.255 192.168.0.1
2020-08-23 15:03:14 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=35 and dwForwardType=4
2020-08-23 15:03:14 Route addition via IPAPI succeeded [adaptive]
2020-08-23 15:03:14 C:\Windows\system32\route.exe ADD 0.0.0.0 MASK 128.0.0.0 yyy.yyy.yyy.yyy
2020-08-23 15:03:14 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=25 and dwForwardType=4
2020-08-23 15:03:14 Route addition via IPAPI succeeded [adaptive]
Bad log:
2020-08-23 15:05:57 TEST ROUTES: 1/1 succeeded len=0 ret=1 a=0 u/d=up
2020-08-23 15:05:57 C:\Windows\system32\route.exe ADD xxx.xxx.xxx.xxx MASK 255.255.255.255 192.168.0.1
2020-08-23 15:05:57 ROUTE: route addition failed using CreateIpForwardEntry: Access is denied. [status=5 if_index=5]
2020-08-23 15:05:57 Route addition via IPAPI failed [adaptive]
2020-08-23 15:05:57 Route addition fallback to route.exe
2020-08-23 15:05:57 env_block: add PATH=C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem
2020-08-23 15:05:57 ERROR: Windows route add command failed [adaptive]: returned error code 1