1

For backup purposes I set up a script that first pings the target network for testing purposes, then starts a VPN connection via openvpn and finally mounts a shared folder in the remote network through that VPN connection.

After a backup has been finished, the folder is unmounted and the VPN connection is closed.

This worked fine for about 3 days. As of now pinging the network works, the VPN connection works, but the mount command has a time out after approximately 2 minutes, only stating "timed out".

A colleague of mine assumes problems with one of the routers, either local or remote network one.

How can I properly determine the reason for the time out? As far as we know, the router settings weren't changed on either network. I already checked for some possible problems with mount, but most solutions assume that it didn't work before.

Edit1: As requested, here are the two scripts (connecting and disconnecting are in seperate scripts). IP is redacted.

Starting:

#!/bin/bash
ping -c 4 XXX.XXX.XXX.1
sleep 5s
echo 'starting VPN connection'
openvpn --config /etc/openvpnconfig/openvpn.ovpn --daemon --auth-nocache --auth-retry none
echo 'OpenVPN started'
sleep 20s
echo 'mount'
if mountpoint -q /mnt/remote; then
  exit 0
else
  mount /mnt/remote
fi

The script checks if the mounpoint already exists to avoid error output in that case. Then the Backup System (bacula) does its job.
Disconnecting:

#!/bin/bash
umount /mnt/remote
output=`ps aux|pgrep openvpn`
set -- $output
pid=$2
kill $pid
2
  • Can you share the script and add it to the question?
    – user308164
    Aug 1, 2016 at 10:04
  • @luchonacho Added the scripts. Aug 1, 2016 at 10:22

0

You must log in to answer this question.

Browse other questions tagged .