|
From: Mike <mi...@ma...> - 2010-05-10 16:33:46
|
Problem with options of routing OpenVPN v. 2.1.1. I have made a test network on Windows. There are four computers: 1. The VPN-Server 2. A computer in a network of the VPN-Server 3. The VPN-Client 4. A computer in a network of the VPN-Client At a server such key parameters: ---------- dev tun proto udp server 10.5.5.0 255.255.255.0 topology subnet ---------- At the client such: ---------- dev tun proto udp client ---------- It is necessary that all each other “saw” through the VPN-channel. I do as it is written in the official documentation - <http://openvpn.net/index.php/open-source/documentation/howto.html#scope> And the following problem appeared. When I write in a configuration file of a server the parameters described in the documentation: ---------- ... Next, add the following line to the main server config file (not the ccd/client2 file): route 192.168.4.0 255.255.255.0 ... ---------- I.e. For my case there will be such parameters: ---------- route 192.168.5.0 255.255.255.0 route 192.168.6.0 255.255.255.0 route 192.168.7.0 255.255.255.0 ---------- That in server log are such messages: ---------- Sun May 09 20:07:20 2010 us=203000 OpenVPN ROUTE: OpenVPN needs a gateway parameter for a --route option and no default was specified by either --route-gateway or --ifconfig options Sun May 09 20:07:20 2010 us=203000 OpenVPN ROUTE: failed to parse/resolve route for host/network: 192.168.5.0 ... ---------- I.e. the server demands to set a gateway for these routes through parameters «route-gateway» or «route» though in the above-stated example from documentation the gateway is not set up. Accordingly in the table of routing I do not see any routes. Then I do so: ---------- route-gateway 10.5.5.1 route 192.168.5.0 255.255.255.0 route 192.168.6.0 255.255.255.0 route 192.168.7.0 255.255.255.0 ---------- Or so (that is equivalent): ---------- route 192.168.5.0 255.255.255.0 10.5.5.1 route 192.168.6.0 255.255.255.0 10.5.5.1 route 192.168.7.0 255.255.255.0 10.5.5.1 ---------- That in server log are such messages: ---------- Sun May 09 20:12:26 2010 us=437000 C:\WINDOWS\system32\route.exe ADD 192.168.5.0 MASK 255.255.255.0 10.5.5.1 Sun May 09 20:12:26 2010 us=437000 ROUTE: route addition failed using CreateIpForwardEntry: Параметр задан неверно. [status=87 if_index=4] Sun May 09 20:12:26 2010 us=437000 Route addition via IPAPI failed [adaptive] Sun May 09 20:12:26 2010 us=437000 Route addition fallback to route.exe ... ---------- But routes are added. Though routing all the same does not work. Then in a config of a server I do so: ---------- route 192.168.5.0 255.255.255.0 10.5.5.5 route 192.168.6.0 255.255.255.0 10.5.5.6 route 192.168.7.0 255.255.255.0 10.5.5.7 ---------- And then routing works: ---------- Sun May 09 20:16:11 2010 us=125000 C:\WINDOWS\system32\route.exe ADD 192.168.5.0 MASK 255.255.255.0 10.5.5.5 Sun May 09 20:16:11 2010 us=125000 Route addition via IPAPI succeeded [adaptive] ---------- But in documentation it is written a little on another... Explain please this situation. PS: in my case 192.168. NNN.0 - the network of NNN-th VPN-Client, and 10.5.5. NNN is an address of its VPN-Connection |