Newbie question - network drive mapping on connection of VPN
Posted: Sun Apr 06, 2014 12:01 pm
Hi All
Very new to OpenVPN, so feeling my way through. Have a pretty newbie question, but have searched the forum and cannot find anything that really points me in the right direction, so hoping to get some help.
Where I am at the moment is: I have the OpenVPN server software running on my remote machine. Not sure of version as it part of a third party application supplied via Synology on their Diskstation NAS. This runs what I believe is a custom version of Linux as it's underlying OS. I have set up the OpenVPN client on my client computer, which is running Win7. Client software is the OpenVPN GUI version 1.03, with OpenVPN version 2.2.2 underlying. After trial and error I can now connect to my network remotely via vpn using OpenVPN, and access my network drives. My network drives are permanent, and show an error when there is no connection to the network host.
Where I want to get to: is for the network drives to be mapped only after a network connection to the host is available. Specifically remotely when the VPN is connected. Having searched found that this is possible by calling a user script in the OpenVPN client configuration file, with the user script being a batch file with a "net use..." command to map the drive.
My problem: The batch file when run on its own works. Analysing the connection logs the client config file is correctly calling the user script. However this is where it all goes wrong. I get an error message saying system error 53...network path not found, and further down one up/down error 2. My thinking is that the mapping script is running to early before the connection script has completed? Working on this I have tried adding "up-delay" in the config file, and "timeout" in the batch file with no success.
Anyone have and idea's. I have placed the line in the config file which calls the user script at the end of the config script such that it is the last action. I have named my batch file the same as the config file, with the suffix "_up". I call the user script in the config file with UP and then the user script filename. The batch file is in the same folder as the config file.Script security is set to 2.
Haven't posted my config script or user script here, but will do if anyone wants to check them for me.
Any pointers would be greatly appreciated
Thanks in advance
Very new to OpenVPN, so feeling my way through. Have a pretty newbie question, but have searched the forum and cannot find anything that really points me in the right direction, so hoping to get some help.
Where I am at the moment is: I have the OpenVPN server software running on my remote machine. Not sure of version as it part of a third party application supplied via Synology on their Diskstation NAS. This runs what I believe is a custom version of Linux as it's underlying OS. I have set up the OpenVPN client on my client computer, which is running Win7. Client software is the OpenVPN GUI version 1.03, with OpenVPN version 2.2.2 underlying. After trial and error I can now connect to my network remotely via vpn using OpenVPN, and access my network drives. My network drives are permanent, and show an error when there is no connection to the network host.
Where I want to get to: is for the network drives to be mapped only after a network connection to the host is available. Specifically remotely when the VPN is connected. Having searched found that this is possible by calling a user script in the OpenVPN client configuration file, with the user script being a batch file with a "net use..." command to map the drive.
My problem: The batch file when run on its own works. Analysing the connection logs the client config file is correctly calling the user script. However this is where it all goes wrong. I get an error message saying system error 53...network path not found, and further down one up/down error 2. My thinking is that the mapping script is running to early before the connection script has completed? Working on this I have tried adding "up-delay" in the config file, and "timeout" in the batch file with no success.
Anyone have and idea's. I have placed the line in the config file which calls the user script at the end of the config script such that it is the last action. I have named my batch file the same as the config file, with the suffix "_up". I call the user script in the config file with UP and then the user script filename. The batch file is in the same folder as the config file.Script security is set to 2.
Haven't posted my config script or user script here, but will do if anyone wants to check them for me.
Any pointers would be greatly appreciated
Thanks in advance