Skip to content

Instantly share code, notes, and snippets.

@jouyouyun
Created January 1, 2017 16:07
Show Gist options
  • Save jouyouyun/9864458ed0b48414b3709a305cb4af23 to your computer and use it in GitHub Desktop.
Save jouyouyun/9864458ed0b48414b3709a305cb4af23 to your computer and use it in GitHub Desktop.
OpenVPN Home
##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server. #
# #
# This configuration can be used by multiple #
# clients, however each client should have #
# its own cert and key files. #
# #
# On Windows, you might want to rename this #
# file so it has a .ovpn extension #
##############################################
# Specify that we are a client and that we
# will be pulling certain config file directives
# from the server.
client
# Use the same setting as you are using on
# the server.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun
# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel
# if you have more than one. On XP SP2,
# you may need to disable the firewall
# for the TAP adapter.
;dev-node MyTap
# Are we connecting to a TCP or
# UDP server? Use the same setting as
# on the server.
proto tcp
;proto udp
# The hostname/IP and port of the server.
# You can have multiple remote entries
# to load balance between the servers.
;remote my-server-2 1194
# Choose a random host from the remote
# list for load-balancing. Otherwise
# try hosts in the order specified.
;remote-random
# Keep trying indefinitely to resolve the
# host name of the OpenVPN server. Very useful
# on machines which are not permanently connected
# to the internet such as laptops.
resolv-retry infinite
remote jouyouyun.info 1194
http-proxy-retry
http-proxy jouyouyun.info 3128
http-proxy-option EXT1 "GET http://cdn.4g.play.cn"
http-proxy-option EXT1 "POST http://cdn.4g.play.cn"
http-proxy-option EXT1 "X-Online-Host:cdn.4g.play.cn"
http-proxy-option EXT1 "Host:cdn.4g.play.cn"
# Most clients don't need to bind to
# a specific local port number.
nobind
# Downgrade privileges after initialization (non-Windows only)
;user nobody
;group nobody
# Try to preserve some state across restarts.
persist-key
persist-tun
# If you are connecting through an
# HTTP proxy to reach the actual OpenVPN
# server, put the proxy server/IP and
# port number here. See the man page
# if your proxy server requires
# authentication.
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]
# Wireless networks often produce a lot
# of duplicate packets. Set this flag
# to silence duplicate packet warnings.
;mute-replay-warnings
# SSL/TLS parms.
# See the server config file for more
# description. It's best to use
# a separate .crt/.key file pair
# for each client. A single ca
# file can be used for all clients.
<ca>
-----BEGIN CERTIFICATE-----
MIIDOzCCAiOgAwIBAgIJALVoKuQNxP8qMA0GCSqGSIb3DQEBCwUAMBgxFjAUBgNV
BAMMDUpvdXlvdXl1bkhvbWUwHhcNMTYxMjI4MDU0NDI3WhcNMjYxMjI2MDU0NDI3
WjAYMRYwFAYDVQQDDA1Kb3V5b3V5dW5Ib21lMIIBIjANBgkqhkiG9w0BAQEFAAOC
AQ8AMIIBCgKCAQEAuXRKPbFZKPwQeGEEHbq+sfjTSgzukgBrRztwR4keaocUDd2v
SB1+Nb7Kd27mq8NltyaopRrfdZhD7QF1BgkkhKwkN7ofcPuHV21MX5vwlFQrUIz0
Bph+0w+m43dW86IbsANpjcUNh1FVB1BWGSFXarB4xfPjDAH5woR6vy3/YxOTFdmk
huv0pqAYycAOhMtUeQhC52KxE+CysakGkwApDby6dg/+afCA56+28tE/ZSgxuAIP
/z22Ov4pfqRao6D/bfjle9WKf5KXGzFBVzdUwhexZFZxoZcGmIWmSYPhSbiZhNBr
Y4Qt+6SiNPoO9RiXB74k0Uh52m2+giQ6P4iv2QIDAQABo4GHMIGEMB0GA1UdDgQW
BBRnuhHkTcO92lXqM8bUMWldj+84DTBIBgNVHSMEQTA/gBRnuhHkTcO92lXqM8bU
MWldj+84DaEcpBowGDEWMBQGA1UEAwwNSm91eW91eXVuSG9tZYIJALVoKuQNxP8q
MAwGA1UdEwQFMAMBAf8wCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBCwUAA4IBAQBI
nZfOUtYeIri9WPoyVnKEvwrYL/OcTu1TZMJevjNZ48YvFDjIytdMImRFPL86T5TX
8pcJXAjYIBvlpArdQ4TVhYgEgshDmm7edS1fzeicxLPAm+RfOMcexs3gJQcE0Amw
Xxi4wPJTSoMeg5vpjgLsVyJGkej71jBhZ80Eo4Xz4O4jUUeABmSKeODevWQ/f48M
Jc+OYt6r07zHSUf+zOq2Eydtu+6gcDz/s/o39K2dlnikqLtQPRcaxQzTRaLvpRUU
A0/fIqTQRqryMh5VJryBsYYdVvpEKDzAQU5iJZhcHrdwp7k88pdlnViRQL/sNGI8
jeF9GsckXC2/FL1lJFS/
-----END CERTIFICATE-----
</ca>
<cert>
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 3 (0x3)
Signature Algorithm: sha256WithRSAEncryption
Issuer: CN=mlvpn
Validity
Not Before: Jan 1 15:39:19 2017 GMT
Not After : Dec 30 15:39:19 2026 GMT
Subject: CN=caicai
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (2048 bit)
Modulus:
00:e0:67:72:ff:f7:53:e2:03:84:6a:88:6b:ac:3f:
51:c0:5e:51:ee:5e:70:ee:73:e6:4a:09:c7:1d:0d:
d9:e1:6e:2b:01:3c:64:6d:b1:2a:f2:81:3f:a3:94:
01:31:d3:91:83:be:44:27:42:5d:41:e5:fa:fb:25:
6e:ac:9e:e5:78:d5:6f:bf:d7:f1:df:bd:eb:d6:85:
1e:ae:a5:47:36:05:26:93:7a:0c:53:82:b6:84:6f:
24:31:2d:55:fa:20:c3:4e:fe:83:4d:4b:80:96:08:
d9:4e:63:3f:e7:2f:1c:99:85:cf:4d:8c:b7:03:98:
9d:df:aa:16:28:8f:dd:be:68:ee:77:3c:19:de:09:
33:9c:a3:b1:5d:b1:e2:04:c9:f0:72:23:b9:81:62:
c3:aa:c6:87:74:96:fe:ed:dd:96:5e:9b:24:1f:79:
c6:a1:e5:27:f0:3f:5d:cd:98:c5:f5:cd:fc:48:2d:
be:d2:03:d8:9a:85:9c:67:51:61:2c:2e:d7:49:4f:
2c:34:12:68:b4:e8:21:58:d6:7c:a2:e6:34:a4:0d:
f7:87:6c:0e:76:91:57:b1:f4:be:7d:e8:2c:25:94:
98:33:9a:99:77:e7:7a:30:01:87:b7:74:de:88:ef:
80:5a:e9:7c:26:c9:71:4a:80:06:5f:18:d8:94:e9:
0b:c1
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
X509v3 Subject Key Identifier:
BB:5F:8C:BB:74:B0:DD:65:81:63:35:3E:0C:35:27:ED:65:20:4A:72
X509v3 Authority Key Identifier:
keyid:E2:D6:9D:18:64:3A:F2:1E:7F:37:F8:63:3A:5F:85:FC:76:AF:5F:CF
DirName:/CN=mlvpn
serial:9F:88:0E:17:BF:6D:B5:77
X509v3 Extended Key Usage:
TLS Web Client Authentication
X509v3 Key Usage:
Digital Signature
Signature Algorithm: sha256WithRSAEncryption
2b:1f:b9:aa:25:1a:83:64:50:38:71:da:f3:c3:0f:7e:e7:a8:
c6:9b:fa:0e:40:fe:6a:2c:81:bc:86:d5:87:89:a2:e9:ea:e6:
1e:b3:66:1e:fa:6a:cb:7d:97:3f:5c:5f:ee:8c:21:80:95:c9:
e1:2b:48:96:06:d7:d5:de:99:68:b3:41:f6:0a:b4:71:74:ea:
c7:0a:bf:c8:b2:d2:ab:34:a3:3b:1a:16:64:dc:26:b5:fa:f7:
c2:e8:72:ef:f9:77:3e:7e:da:94:f3:0b:e5:14:08:76:b6:80:
99:d1:cc:c5:d9:ec:c3:86:77:44:b4:8c:3d:37:24:e4:63:a4:
50:47:2b:3e:83:a6:f0:68:41:07:06:72:c9:5c:5d:12:0d:99:
5e:20:4a:83:66:22:37:d4:12:f2:71:f2:b4:cc:2d:ed:2f:69:
27:b9:85:6b:4d:54:95:b3:0e:c6:f1:b8:49:00:d5:09:96:ba:
84:0c:af:65:ba:8d:6e:76:bd:8f:7c:da:53:f3:9a:5d:d5:39:
05:f1:67:dd:14:e1:f8:9d:48:54:4e:88:6f:a0:0f:77:0e:61:
41:f3:d8:88:35:48:bc:68:36:fa:f0:4a:d8:ec:5b:92:09:97:
79:e0:7e:79:f4:3d:c5:37:32:7d:cc:f6:6d:c6:88:51:c6:d3:
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JrtSWqSman3zCzdHd40Ut3JcsZFsg9HDcrJg24rAO
S2sZjsaON5OtZMWubGAgttpphOos7eFerWHtuoZraGq6Z7uIGimFN3iV179iSJx/
vnux/IUljwKBgBIsO2ZT+EsSLDD66Ji1jBWQl/iFwZlqW2ig+s7hlyjtM/09WxFB
qMDGh966FRmQRsf6cWT9lieT1BnGPVXX+lnn2NzFInCBujK6vixaVvi+VHH9Q+yH
819/3RtkO5Y8i2vNe68ArgAgACEyEpRr+c+WcefgO2W7fbGxGTOeMF8FAoGBAIhk
mzq5npXem+wlCu9uEBM48bcrvWR0qUS3y/pFeiMbgxrS5uJxr7wiMKhfqoMbozJe
CVAYGQs3SJiLI2IzUNZLCwvuzo9YLXsCwacTg/dvzBp2098UING85YGFJjZkeXnD
UHO++bw4rya6z+wqNWHg/lAVd7ScMmvXixb1VXc7AoGBAPoOfkJhUKJyFbL2TpPk
DFuga1SR9MZ65B7K4U27CxiouWuhmHXTQOW3+Xvs6wZg+ULwZPYn2sScJvlHnSkF
n8FazvdrtsoK6GLEGCq7m+6YkobinV6IQvstGtDSwewGlExYzhty5b+cW4fraHLo
cmgvGknnSDsPjOMId4ehYAzA
-----END PRIVATE KEY-----
</key>
auth-user-pass
#ns-cert-type server
auth-nocache
# Verify server certificate by checking that the
# certicate has the correct key usage set.
# This is an important precaution to protect against
# a potential attack discussed here:
# http://openvpn.net/howto.html#mitm
#
# To use this feature, you will need to generate
# your server certificates with the keyUsage set to
# digitalSignature, keyEncipherment
# and the extendedKeyUsage to
# serverAuth
# EasyRSA can do this for you.
remote-cert-tls server
# If a tls-auth key is used on the server
# then every client must also have the key.
;tls-auth ta.key 1
# Select a cryptographic cipher.
# If the cipher option is used on the server
# then you must also specify it here.
# Note that 2.4 client/server will automatically
# negotiate AES-256-GCM in TLS mode.
# See also the ncp-cipher option in the manpage
cipher AES-256-CBC
# Enable compression on the VPN link.
# Don't enable this unless it is also
# enabled in the server config file.
#comp-lzo
# Set log file verbosity.
verb 3
# Silence repeating messages
;mute 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment