Page 1 of 1

[SOLVED] Mount NFS after connect

Posted: Fri Jun 15, 2018 7:13 am
by Jomart
Hi,
I need to mount a NFS share after connection was established.
I have modified my .ovpn with that :

Code: Select all

script-security2
up /path/to/script.sh
And my script contain :

Code: Select all

#!/bin/sh
mount -t nfs IP:/data /home/data
(I can mount the NFS manually when the VPN connection was established) but when I add the option "up" in my .ovpn, I have the message "connection established" but I can't ping my NFS server ...

P.S : For testing I launched VPN & my script in root

Any idea ?
Thank's

Re: Mount NFS after connect

Posted: Fri Jun 15, 2018 10:46 am
by TinCanTech
Your script does not work because all scripts must return completed before the VPN will pass any data.

This is by design and for security.

Re: Mount NFS after connect

Posted: Fri Jun 15, 2018 10:52 am
by Jomart
Any idea how I can do that? (My NFS mount) inside the .ovpn

Re: Mount NFS after connect

Posted: Fri Jun 15, 2018 10:55 am
by TinCanTech
You cannot use openvpn to initiate this connection .. so use something else.

(Technically, you can use openvpn but as you can see, it will ultimately fail)

Re: Mount NFS after connect

Posted: Fri Jun 15, 2018 12:35 pm
by Jomart
Ok thank's :)
Have a nice day