VPN provider AirVPN has a setup for openvpn through SSH and SSL tunnels.
This is the script used to make the SSH connection to AirVPN and to start a local daemon to receive the openvpn connection.
#!/bin/bash
# --------------------------------------------------------
# Air VPN |
https://airvpn.org | Monday 13th of October 2014 04:02:55 AM
# SSH Client Configuration, Linux/OSX
# AirVPN_SG-Antares_SSH-80
# --------------------------------------------------------
chmod 600 sshtunnel.key
while :
do
echo ""; echo "AirVPN SSH Tunnel"
ssh -i sshtunnel.key -L 1412:127.0.0.1:2018 sshtunnel@VPNIPAddress -p 80 -N -T -v
read -t 5 -p "Retry? (or wait 5 sec for Y)" yn
if [[ $yn == "n" || $yn == "N" ]]; then break; fi
done
The openvpn config main points for how it connects are:
remote 127.0.0.1 1412
route VPNIPAddress 255.255.255.255 net_gateway
so that it first connects to the daemon the script created, but then tunnels through it to the VPN server
maybe this will help you.