dperson / openvpn-client

GNU Affero General Public License v3.0
1.05k stars 588 forks source link

Getting starting issues, connecting TeamSpeak to OpenVPN-client #337

Open enordstrand opened 3 years ago

enordstrand commented 3 years ago

Hello I have some getting starting issues to get this up and running.

I have access to a remote OpenVPN-server which I authenticates to through a verification code that I get through the mobile app "Sophos Authenticator".

The case is that I want to set up a Teamspeak-server behind our company's firewall, and be able to connect to this Teamspeak-server from outside the firewall through VPN. My idea is to launch a Teamspeak server Docker container, and connect it to dperson/openvpn-client so that the Teamspeak-server gets an IP from the remote OpenVPN-server.

Then, other users should be able to connect to the same OpenVPN-server and then be able to connect to the Teamspeak-server.

So, what I have been able to do so far is to run: sudo docker run -it --cap-add=NET_ADMIN --device /dev/net/tun --name vpn -v /var/www/OpenVPN2/crt:/vpn -d dperson/openvpn-client and then to enter the container: docker exec -it vpn /bin/bash

From here I am able to go into the vpn-folder and edit my extern.ovpn-file. I have tried change the line for auth-user-pass to point to auth.txt like this: auth-user-pass auth.txt

And by running openvpn --config extern.ovpn I get automatically successfully connected to the VPN-server. Now, inside this docker image, I'm not sure how to proceed, because I am not able to write any further commands after this command.

So, my question is, what exactly should I do to get from where I am now, and to be able to run Teamspeak through this docker-container?

The command for running a teamspeak-server is: docker run -p 9987:9987/udp -p 10011:10011 -p 30033:30033 -e TS3SERVER_LICENSE=accept teamspeak

Thanks a lot for any support on this. Preferrably there should be another command than the one I use for running openvpn-client that directly connects to the VPN-server, where I can enter my userid and code into this command.

enordstrand commented 3 years ago

Never mind, I got it to work.

  1. Run the docker image with sudo docker run -p 9987:9987/udp -p 10011:10011 -p 30033:30033 -it --cap-add=NET_ADMIN --device /dev/net/tun --name vpn -v /var/www/OpenVPN2/crt:/vpn -d dperson/openvpn-client (The ports are those that bellongs to teamspeak vpn)
  2. Start the vpn-connection with openvpn --config extern.ovpn and log in with user and pw
  3. Exiting the running vpn-docker by clicking ctrl+p, ctrl+q and then opening the new docker with
  4. Launching the Teamspeak docker image with --net=container:vpn like this: docker run --net=container:vpn -e TS3SERVER_LICENSE=accept teamspeak