Last active
December 28, 2021 15:15
-
-
Save shiroamada/ed7c726141ea65ad027e7f95772ded99 to your computer and use it in GitHub Desktop.
Docker OpenVPN Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create and Initialize OpenVPN (Create OpenVPN Config) | |
docker run --rm -v $PWD:/etc/openvpn kylemanna/openvpn ovpn_genconfig -u udp://192.168.0.191:1194 | |
# Create certificate | |
docker run --rm -v $PWD:/etc/openvpn -it kylemanna/openvpn ovpn_initpki | |
# Create client account | |
docker run --rm -v $PWD:/etc/openvpn -it kylemanna/openvpn easyrsa build-client-full client | |
# Copy client certificate (ovpn file) from container | |
docker run --rm -v $PWD:/etc/openvpn -it kylemanna/openvpn ovpn_getclient client > client.ovpn | |
# Start OpenVPN Container | |
docker run --name openvpn -v $PWD:/etc/openvpn -d -p 1194:1194/udp --cap-add=NET_ADMIN --restart always kylemanna/openvpn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment