-
Hello, I have been trying to setup a custom provider with gluten for a few days now and haven’t been able to figure out the documentation at all. I am immediately confused when reading this documentation, Can you please provide an example of this file so I can hopefully continue moving forward. |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 15 replies
-
In Linux, OpenVPN client configuration files are slightly different than those used in Windows or for phones/tablets. The file containing the OpenVPN client directives is in a .conf file, the certificate authority and client certificate are .crt files, and the client key and static (ta) key are .key files. These separate files can generally be downloaded together from your provider as a .zip file. If that's not an option, and you only have a .ovpn file, these certificates and keys can be extracted and put in separate files. In place of the each of these keys, assuming you're extracting them from a .ovpn file, would be the following additional directives in a .conf file: ca ca.crt # ca followed by the name of the ca cert
cert client.crt # cert followed by the name of the client cert
key client.key # key followed by the name of the client key
ta ta.key # ta followed by the name of the static key (if used) |
Beta Was this translation helpful? Give feedback.
-
Here's a client config for a private OpenVPN server of my own (sensitive info changed of course): dev tun
# lport 0
# compress lz4-v2
client
proto udp
remote whatever.duckdns.org 1194
resolv-retry infinite
nobind
remote-cert-tls server
tls-version-min 1.2
verify-x509-name OpenVPN-Server name
persist-tun
persist-key
cipher AES-256-GCM
auth SHA256
auth-nocache
# tls-client
ca ca.crt
cert client.crt
key client.key
ta ta.key Same OpenVPN client directives as a .ovpn file, minus the certificates and keys. |
Beta Was this translation helpful? Give feedback.
-
Try putting just that key back into the .conf file, and add a key-direction directive, in the form: key-direction 1
<tls-auth>
-----BEGIN OpenVPN Static key V1-----
. . .
-----END OpenVPN Static key V1-----
</tls-auth> Also your directory bindings need to be re-worked to look like this: - /home/dlone/Configs/gluten-config/custom.conf:/gluetun/custom.conf:ro
- /home/dlone/Configs/gluten-config:/gluetun You need to bind the custom.conf file as an ro file, but the rest is handled by just binding the directory containing the certs and keys. |
Beta Was this translation helpful? Give feedback.
-
Also just noticed you have gluetun misspelled in a couple of places in your bindings -- not a show stopper as long as you know they're wrong. |
Beta Was this translation helpful? Give feedback.
-
It looks like your private key may be password protected. I believe there's a directive you can use to specify a filename to put the password in -- which you would then put in the same directory with the keys and certs. I think it'd look like this (you should probably verify this in the OpenVPN documentation): askpass my.pass Where my.pass is a text file containing only the password for your private key. |
Beta Was this translation helpful? Give feedback.
-
askpass followed by a filename like dlone.pass is correct, and needs to go in the .conf file. Then place a file with that name in the directory with the keys and certs. |
Beta Was this translation helpful? Give feedback.
-
You are connecting to the OpenVPN server, but you may not have Internet yet. Check the setup on your OpenVPN Access Server. Also, the permissions on your key and password file are too broad -- and should be fixed at some point, probably to have root as owner and group. |
Beta Was this translation helpful? Give feedback.
-
Do all of the directives match between the .ovpn file on your phone and the .conf file Gluetun is using? Do you have a firewall on your Docker host, and if so is the port you're using open? |
Beta Was this translation helpful? Give feedback.
-
Ok here is my current docker-compose
and here is my custom.conf
This is my current log.
|
Beta Was this translation helpful? Give feedback.
-
So I decided to spin-up an OpenVPN Access Server (in a Proxmox LXC container) to see for myself what would be required to connect with Gluetun -- and it turns out to be fairly straightforward. From your OpenVPN AS web interface generate a .ovpn file and download it to the directory you're going to bind to Gluetun (no modifications or extraction of certs and keys is required). The directory should be empty except for the .ovpn file (after first run there will be a servers.json file there too). Then use the following docker-compose: version: '3.7'
services:
gluetun:
image: qmcgaw/gluetun:latest
container_name: gluetun
cap_add:
- NET_ADMIN
environment:
- VPN_SERVICE_PROVIDER=custom
- VPN_TYPE=openvpn
- OPENVPN_CUSTOM_CONFIG=/gluetun/xxx.ovpn # Replace with the actual name of your .ovpn file
- OPENVPN_USER=openvpn # OpenVPN AS username here (openvpn is the default user)
- OPENVPN_PASSWORD=xxx # Password associated with the username
- TZ=US/Mountain # Timezone in standard Linux format
volumes:
- /data/openvpnas/xxx.ovpn:/gluetun/xxx.ovpn:ro # Bind the directory/filename to /gluetun/xxx.ovpn here with ro option
- /data/openvpnas:/gluetun # /data/openvpnas will be used for servers.json There are other ways to approach this, but using the above method requires the fewest "moves". |
Beta Was this translation helpful? Give feedback.
-
Are you up-and-running with Gluetun and OpenVPN AS? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
@dyl4n20
So I decided to spin-up an OpenVPN Access Server (in a Proxmox LXC container) to see for myself what would be required to connect with Gluetun -- and it turns out to be fairly straightforward. From your OpenVPN AS web interface generate a .ovpn file and download it to the directory you're going to bind to Gluetun (no modifications or extraction of certs and keys is required). The directory should be empty except for the .ovpn file (after first run there will be a servers.json file there too).
Then use the following docker-compose: