Created
May 12, 2018 15:52
-
-
Save syntaxerrormmm/17991751e781cd83d5b0380f4b7bb61c to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
clientname=$1; shift | |
# Generate certificates | |
./easyrsa build-client-full ${clientname} nopass | |
# Generating all-in-one configuration | |
cat > configs/${clientname}.ovpn<<EOC | |
client | |
pull | |
dev tun | |
proto udp | |
remote sys42.eu 1194 | |
resolv-retry infinite | |
nobind | |
persist-key | |
persist-tun | |
key-direction 1 | |
<ca> | |
`cat pki/ca.crt` | |
</ca> | |
<cert> | |
`cat pki/issued/${clientname}.crt` | |
</cert> | |
<key> | |
`cat pki/private/${clientname}.key` | |
</key> | |
<tls-auth> | |
`cat pki/private/ta.key` | |
</tls-auth> | |
remote-cert-tls server | |
comp-lzo | |
verb 3 | |
mssfix 1428 | |
fragment 1428 | |
EOC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment