How to generate client with specific port ?
Hi
I read all the documentation. I think I understood a lot of things as have two instances of the docker-openvpn to have two protocol / port different BUT I didn't understand how to generate a client with the good port. I got always a client with 1194. So for the moment I edit the file at hand.
I tried: --port or -p to generate with the good port but starting with that I'm sticked:
docker-compose run --rm openvpn easyrsa build-client-full $CLIENTNAME
docker-compose run --rm openvpn ovpn_getclient $CLIENTNAME > $CLIENTNAME.ovpn
If you have any idea, I take it. Maybe I miss something in the doc, you will tell me :)
Thank you in advance,
Regards
easyrsa is a separate CLI utility, looking at its source ( build-client-full in easyrsa-v3) I see that there are only 2 parameters (username which is also the filename and an optional password), so you cannot set the port name using this call, I think. I guess you can install easyrsa locally and play with it, maybe you can find a command that suits you.
In my opinion easyrsa is in no way connected to this issue.
What @kevincaradant wants is to edit the $OVPN_PORT at https://github.com/kylemanna/docker-openvpn/blob/master/bin/ovpn_getclient#L40, which is not possible right now as it comes from the ovpn_env.sh script.
I want to do exactly what @marvin-w describes. The idea is to run several different VPNs on the same host.
Hey again, i adapted the ovpn_getclient script to allow a custom port:
https://github.com/LindezaGrey/docker-openvpn/blob/master/bin/ovpn_getclient
you would call it like this: docker-compose run --rm openvpn ovpn_getclient $CLIENTNAME > $CLIENTNAME.ovpn 1195
Of course you would have to build your own docker image first.
best regards!
I change the port using a simple string replacement inline with the sed command like this:
openvpn ovpn_getclient $CLIENTNAME | sed "s/1194 udp/$NEW_PORT udp/g" > $CLIENTNAME.ovpn