Sign inSign up

4ss078/docker-openvpn

By 4ss078

•Updated over 2 years ago

OpenVPN 2.5.1 built on May 14 2021, container to create Server and or Client VPN.

Image
Networking
Security
0

1.8K

4ss078/docker-openvpn repository overview

OpenVPN

⁠Docker OpenVPN

OpenVPN 2.5.1 built on May 14 2021, container to create Server and or Client VPN. This allows you to use OpenVPN without needing to install it on your computer and regardless of your operating system (Linux or Windows).

⁠Requirement

Docker must be configured to run Linux Docker containers. You need the certificates, you can use Docker-openssl⁠

⁠Generate OpenVPN configuration files

For generating the configuration file, you can use the environmerts:

  • GENERATE_SERVER (false default)
  • SERVER_PORT (1-65535, 1194 default)
  • SERVER_PROTO (TCP/UDP, UDP default)
  • REDIRECT_GATEWAY (false default) if true, enable the server to push to clients "redirect-gateway def1 bypass-dhcp"
  • GENERATE_CLIENT (false default)
  • FORWARD (false default) to forward inside the tunnel, ports from 1 to 64000

Remember, without server.conf you can not generate the client file. Docker-openssl⁠

# Make sure you replace `<your_path>` with your target folder, this is the path where files will be created.
# To generate the Certification Authority, Server and Clinet certificate you can use Docker-openssl

docker run --rm -v your_path:/opt -e GENERATE_SERVER=true \
                                  -e REDIRECT_GATEWAY=true \
                                  -e GENERATE_CLIENT=true \
                                  4ss078/docker-openvpn:latest

# After this command, you are going to have in your folder the client.conf, server.conf files

⁠Create Docker Container Server Mode

# Make sure you replace `<your_path>` with your target folder, this is where files will be created.
# In this case the docker runs every .conf file locates in your_path/openvpn
# To generate the Certification Authority, Server and Clinet certificate use Docker-openssl 

docker run --network host -v your_path:/opt --privileged --cap-add=NET_ADMIN --device=/dev/net/tun -e RUN_SERVER=true 4ss078/docker-openvpn:latest

⁠Create Docker Container Client Mode


# Run Docker container in interactive mode
# In this case the docker runs every .ovpn file locates in your_path/openvpn
# Make sure you replace `<your_path>` with your target folder, this is where the client.conf files will be placed.

docker run --network host -v your_path_of_client.conf:/opt --cap-add=NET_ADMIN --device=/dev/net/tun -e RUN_CLIENT=true 4ss078/docker-openvpn:latest

Tag summary

Content type

Image

Digest

sha256:3edfaa651…

Size

53.9 MB

Last updated

over 2 years ago

docker pull 4ss078/docker-openvpn