[SOLVED] Mount NFS after connect

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
Jomart
OpenVpn Newbie
Posts: 3
Joined: Fri Jun 15, 2018 7:06 am

[SOLVED] Mount NFS after connect

Post by Jomart » Fri Jun 15, 2018 7:13 am

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
Last edited by Jomart on Fri Jun 15, 2018 12:35 pm, edited 1 time in total.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Mount NFS after connect

Post by TinCanTech » Fri Jun 15, 2018 10:46 am

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.

Jomart
OpenVpn Newbie
Posts: 3
Joined: Fri Jun 15, 2018 7:06 am

Re: Mount NFS after connect

Post by Jomart » Fri Jun 15, 2018 10:52 am

Any idea how I can do that? (My NFS mount) inside the .ovpn

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Mount NFS after connect

Post by TinCanTech » Fri Jun 15, 2018 10:55 am

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)

Jomart
OpenVpn Newbie
Posts: 3
Joined: Fri Jun 15, 2018 7:06 am

Re: Mount NFS after connect

Post by Jomart » Fri Jun 15, 2018 12:35 pm

Ok thank's :)
Have a nice day

Post Reply