dperson / openvpn-client

GNU Affero General Public License v3.0
1.06k stars 586 forks source link

How to use with ovpn files ? #380

Open ha62791 opened 3 years ago

ha62791 commented 3 years ago

Unfortunately there isn't a docker image for openvpn3 client Is this container able to connect vpn like the way we use openvpn3 with ovpn files ?

In openvpn3, we can do like this: openvpn3 session-start --config /path/to/config.ovpn

wangjoshuah commented 3 years ago

@dperson @ha62791 I'm in the same boat. Did either of you find a solution?

al2suarez commented 3 years ago

@dperson @ha62791 @wangjoshuah

Yes, please support ovpn files.

al2suarez commented 3 years ago

@dperson @ha62791 @wangjoshuah

figured it out... i feel stupid... just change your ovpn file to vpn.conf

Thats it... i did have to remove the following line entries from my ovpn file:

data-ciphers AES-128-GCM:AES-256-GCM data-ciphers-fallback AES-256-GCM

and then set cipher when running the docker like so...

sudo docker run -it --cap-add=NET_ADMIN --device /dev/net/tun --name vpn -v /somepath/ovpn:/vpn -e CIPHER=AES-256-GCM -d dperson/openvpn-client -a 'username;password'

GreenFrogSB commented 2 years ago

I was stuck on this for a while also. I had to remove below three lines from my ovpn file on top of changing ovpn extension to conf

Error on container start: Options error: --up script fails with '/etc/openvpn/update-resolv-conf': No such file or directory (errno=2)

Removed: script-security 2 up /etc/openvpn/update-resolv-conf down /etc/openvpn/update-resolv-conf

I documented all in here if anyone is trying to get VPN working using docker-compose Making a Docker Containers use a VPN

S474N commented 2 years ago

@GreenFrogSB excellent website!

Is some way to add support for telegram notifying of VPN up/down?