This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14898|Reply: 0

[VPN] Routing issues when using OpenVPN in Windows 7

[Copy link]
Posted on 9/22/2015 11:02:34 AM | | |
Tue Sep 22 10:56:45 2015 TAP-Win32 Driver Version 9.8
Tue Sep 22 10:56:45 2015 TAP-Win32 MTU=1500
Tue Sep 22 10:56:45 2015 Notified TAP-Win32 driver to set a DHCP IP/netmask of 193.168.100.6/255.255.255.0 on interface {FC0EF599-16D1-4496-96FE-4B5E38804B80} [DHCP-serv: 193.168.100.0, lease-time: 31536000]
Tue Sep 22 10:56:45 2015 Successful ARP Flush on interface [23] {FC0EF599-16D1-4496-96FE-4B5E38804B80}
Tue Sep 22 10:56:50 2015 TEST ROUTES: 1/1 succeeded len=0 ret=1 a=0 u/d=up
Tue Sep 22 10:56:50 2015 C:\WINDOWS\system32\route.exe ADD 139.129.128.133 MASK 255.255.255.255 100.64.22.146
Tue Sep 22 10:56:50 2015 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=20 and dwForwardType=4
Tue Sep 22 10:56:50 2015 Route addition via IPAPI succeeded [adaptive]
Tue Sep 22 10:56:50 2015 C:\WINDOWS\system32\route.exe ADD 0.0.0.0 MASK 128.0.0.0 193.168.100.1
Tue Sep 22 10:56:50 2015 ROUTE: route addition failed using CreateIpForwardEntry: At least one parameter is incorrect.   [status=160 if_index=23]
Tue Sep 22 10:56:50 2015 Route addition via IPAPI failed [adaptive]
Tue Sep 22 10:56:50 2015 Route addition fallback to route.exe
Done!
Tue Sep 22 10:56:50 2015 C:\WINDOWS\system32\route.exe ADD 128.0.0.0 MASK 128.0.0.0 193.168.100.1
Tue Sep 22 10:56:50 2015 ROUTE: route addition failed using CreateIpForwardEntry: At least one parameter is incorrect.   [status=160 if_index=23]
Tue Sep 22 10:56:50 2015 Route addition via IPAPI failed [adaptive]
Tue Sep 22 10:56:50 2015 Route addition fallback to route.exe
Done!
Tue Sep 22 10:56:50 2015 Initialization Sequence Completed
Tue Sep 22 10:56:59 2015 Replay-window backtrack occurred [1]
Many programs don't have a Windows 7 version right now, and many of them need to be installed and used in Windows XP-compatible mode, as is the case with OpenVPN's Windows client. To install the file in the property selection of Windows XP and run as administrator, the installed run file also selects these two options. If you still can't connect to the VPN network, you need to add it in the configuration file (just add these two lines at the end of the client.ovpn file):
route-method exe
route-delay 2

This will add the route correctly in the machine, otherwise you will see something like this in the log file:

ROUTE: route addition failed using CreateIpForwardEntry: 至少有一个参数不正确。

Route addition via IPAPI failed

The parameters of these two openvpn commands are explained as follows:
--route-method m
  Which method m to use for adding routes on Windows?
  ipapi (default) -- Use IP helper API.
  exe -- Call the route.exe shell command.

--route-delay [n] [w]
  Delay n seconds (default=0) after connection establishment, before adding routes. If n is 0, routes will be added immediately upon

connection establishment. If --route-delay is omitted, routes will be added immediately after TUN/TAP device open and --up scrip{filter}t execution, before any --user or --group privilege downgrade (or --chroot execution.)
  This  option is designed to be useful in scenarios where DHCP is used to set tap adapter addresses.  The delay will give the DHCP handshake time to complete before routes are added.
  On Windows, --route-delay tries to be more intelligent by waiting w seconds (w=30 by  default)  for  the  TAP-Win32 adapter to come up before adding routes.





Previous:A "graduation project" template dedicated to graduating computer science software
Next:How to test whether your network is disabled for UDP protocol?
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com