pierre
When I was using OpenVPN 2.0.x, I was able to set the VPN clients to use static IP addresses and that worked fine.
Starting with (I believe) 2.1.x (required when I switched to Win7 x64), static addresses no longer worked because I was getting (and still get with openvpn-install-2.3.2-I003-x86_64.exe)
Sat Apr 19 23:49:02 2014 TAP-Windows Driver Version 9.9
Sat Apr 19 23:49:03 2014 NETSH: C:\Windows\system32\netsh.exe interface ip set address VPN dhcp
Sat Apr 19 23:49:03 2014 ERROR: netsh command failed: returned error code 1
Sat Apr 19 23:49:08 2014 NETSH: C:\Windows\system32\netsh.exe interface ip set address VPN dhcp
Sat Apr 19 23:49:08 2014 ERROR: netsh command failed: returned error code 1
So I reverted to using DHCP on the clients, and discovered I could specify the ip addresses used by each client in ipp.txt on the server. But that file sometimes gets rewritten (have not figured out why), and clients no longer get the IP addresses I want. I got around that by monitoring the file with a scheduled task on the server and recopying a reference file, then stopping and starting the OpenVPN service.
That works fine, but, with the VPN adapter on the clients set to DHCP, the clients get no gateway assigned, since their IP addresses are not coming from the DHCP server in the router. As a result, Windows (Win7 x64) treats the adapter as not being connected to the internet, therefore labels it "unidentified network", and therefore it becomes a Public network with no possibility of changing it to a Home network, with the consequences about Windows Firewall.
I have been able to get around that problem with connect and disconnect scripts to set the adapter to static ip after connect, and back to DHCP after disconnect, using the netsh command. But that requires running OpenVPN with administrator privileges. That's ok, but then you cannot start OpenVPN in the Startup folder without user intervention to say Yes to the security prompt.
I got around that problem by defining a task with admin privileges that starts OpenVPN (and you don't get a security prompt), and then starting that task in the Startup folder.
If you have been reading this far and followed me, thank you. As you can see, the mere change of not being able to set clients on static IPs has triggered a series of problems, which I have solved one by one. But I consider this band-aids on top of band-aids, and I would like to clean this up.
So I have several questions:
1) Is there a way to have VPN clients be on static IP and not have OpenVPN complain about it, the way it used to work in 2.0.x.
2) If not, can I have a gateway (the router of the OpenVPN server network) passed to the clients? If so how?
3) If not, then what do you suggest?
Thanks in advance for your help.
Pierre
pierre
I would think that both the config files and the logs contain personal information (IP addresses, port number, host name, ....) is it ok to substitute xxxx for those?
I do have a log on the server but not on the client. How come?
The server log is too long to post so I will have to stop the service, delete the log, and restart. Then I will attempt to connect with a fixed IP, then stop the server again and grab the log.
Is that the way to do it?
Thanks.
Pierre