Docker-openvpn: Can't connect to VPN with custom port

Created on 8 Apr 2016  Â·  8Comments  Â·  Source: kylemanna/docker-openvpn

When I run :
docker run --volumes-from $OVPN_DATA -d -p 443:1194/udp --cap-add=NET_ADMIN kylemanna/openvpn

I think my .ovpn file should have something like :
remote hostname 80 udp

Instead I got :
remote hostname 1194 udp

I understand from the container perspective, you are internally mapped to 1194 so the .ovpn file is 1194 but this file will be used from another host so it should be 80 since we pass through docker ?

Maybe I'm missing something...
Can you help me?

Most helpful comment

@patrick-mota so how did you pass the -p attribute? I'm having the same problem.

All 8 comments

The command for docker above states that it will map the host 443 external to 1194/udp on the container. What is your goal?

Yes that's ok but when you do :
docker run --volumes-from $OVPN_DATA --rm kylemanna/openvpn ovpn_getclient CLIENTNAME > CLIENTNAME.ovpn

the .ovpn use the port 1194 it should be fine if we used the standard port or -p 1194:1194 but if you use 80:1194 it will not work.

The goal is simply to use the VPN in a remote server using port 80 instead of 1194.

Pass port 80 (and the proto tcp vs udp) when you run genconfig. The scripts store the port internally since there is no way to determine the external port mapping and if you change the -p option in a subsequent run it doesn't work.

Big thanks kylemanna !
It was like you said I just did :
docker run --volumes-from $OVPN_DATA --rm kylemanna/openvpn ovpn_genconfig -u tcp://VPN.SERVERNAME.COM

Glad to hear you got it working!

@patrick-mota so how did you pass the -p attribute? I'm having the same problem.

@vmsantos It has been quite a lot of time since you asked, but just answering for future viewers.

It can be done by passing -u tcp://VPN.SERVERNAME.COM:80 to ovpn_genconfig as documented here: https://github.com/kylemanna/docker-openvpn/blob/master/docs/tcp.md#using-tcp

Thanks!

Em sex, 25 de dez de 2020 08:36, Saad Ismail notifications@github.com
escreveu:

@vmsantos https://github.com/vmsantos It has been quite a lot of time
since you asked, but just answering for future viewers.

It can be done by passing -u tcp://VPN.SERVERNAME.COM:80 to ovpn_genconfig
as documented here:
https://github.com/kylemanna/docker-openvpn/blob/master/docs/tcp.md#using-tcp

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/kylemanna/docker-openvpn/issues/120#issuecomment-751236839,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHSHPHUYRLIHR6EQUMFT5CTSWR2NJANCNFSM4CALQYNA
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kevincaradant picture kevincaradant  Â·  5Comments

antoninbouchal picture antoninbouchal  Â·  3Comments

yadaom picture yadaom  Â·  4Comments

rottmann picture rottmann  Â·  8Comments

arukaen picture arukaen  Â·  6Comments