Ubuntu部署OpenVPN服务

0x00 前言

OpenVPN是一款跨平台的开源VPN软件,它利用虚拟网卡,以一种全新的方式实现了SSL VPN的功能,能够适应IP层之上的几乎所有应用。它使用TCP或UDP协议进行通信,相比于其它VPN,具有更好的NAT兼容性。

以下以腾讯云的Ubuntu 16.04.1 TLS 64位系统作为部署环境。
如无特别说明,以下所执行的命令都需要root权限。

0x01 创建证书

如果已经有证书,可以忽略本步操作。

安装easy-rsa

apt-get -y install easy-rsa

修改证书配置

cd /usr/share/easy-rsa

vi vars

修改以下变量的默认配置:

  1. export KEY_COUNTRY="US"
  2. export KEY_PROVINCE="CA"
  3. export KEY_CITY="SanFrancisco"
  4. export KEY_ORG="Fort-Funston"
  5. export KEY_EMAIL="me@myhost.mydomain"
  6. export KEY_OU="MyOrganizationalUnit"
COPY

如:

  1. export KEY_COUNTRY="CN"
  2. export KEY_PROVINCE="GD"
  3. export KEY_CITY="Shenzhen"
  4. export KEY_ORG="drunkdream"
  5. export KEY_EMAIL="admin@drunkdream.com"
  6. export KEY_OU="drunkdream"
COPY

# export KEY_CN="CommonName"改为:export KEY_CN="server"

source ./vars

./clean-all

生成根证书

./build-ca

如果出现以下错误:

140695501473432:error:0E065068:configuration file routines:STR_COPY:variable has no value:conf_def.c:584:line 198

139878249313944:error:0E065068:configuration file routines:STR_COPY:variable has no value:conf_def.c:584:line 220

请注释掉198行和220行的内容:

subjectAltName=$ENV::KEY_ALTNAMES

一路回车,完成后,会在keys目录下生成ca.crt和ca.key。

生成服务器证书和密钥

./build-key-server server

遇到Sign the certificate? [y/n]以及1 out of 1 certificate requests certified, commit? [y/n]

请输入y,并回车;其它情况直接回车即可。

完成后,会在keys目录下生成server.crt、server.csr、server.key三个文件。

生成Diffie-Hellman密钥

./build-dh

该步操作耗时较长,请耐心等待。

完成后,会在keys目录下生成dh2048.pem文件。

生成客户端证书和密钥

./build-key client

与前面的步骤相同,在Sign the certificate1 out of 1 certificate requests certified, commit?两处输入y并回车,其它地方直接回车即可。

完成后,会在keys目录下生成client.crt、client.csr、client.key三个文件。

0x02 安装OpenVPN并修改配置

apt-get -y install openvpn

OpenVPN的配置文件目录为:/etc/openvpn。

将之前生成的ca.crt、server.crt、server.key、dh2048.pem这四个文件拷贝到/etc/openvpn目录。

创建/etc/openvpn/server.conf文件,内容如下:

  1. #################################################
  2. # Sample OpenVPN 2.0 config file for #
  3. # multi-client server. #
  4. # #
  5. # This file is for the server side #
  6. # of a many-clients <-> one-server #
  7. # OpenVPN configuration. #
  8. # #
  9. # OpenVPN also supports #
  10. # single-machine <-> single-machine #
  11. # configurations (See the Examples page #
  12. # on the web site for more info). #
  13. # #
  14. # This config should work on Windows #
  15. # or Linux/BSD systems. Remember on #
  16. # Windows to quote pathnames and use #
  17. # double backslashes, e.g.: #
  18. # "C:\\Program Files\\OpenVPN\\config\\foo.key" #
  19. # #
  20. # Comments are preceded with '#' or ';' #
  21. #################################################
  22. # Which local IP address should OpenVPN
  23. # listen on? (optional)
  24. ;local a.b.c.d
  25. # Which TCP/UDP port should OpenVPN listen on?
  26. # If you want to run multiple OpenVPN instances
  27. # on the same machine, use a different port
  28. # number for each one. You will need to
  29. # open up this port on your firewall.
  30. port 1194
  31. # TCP or UDP server?
  32. ;proto tcp
  33. proto udp
  34. # "dev tun" will create a routed IP tunnel,
  35. # "dev tap" will create an ethernet tunnel.
  36. # Use "dev tap0" if you are ethernet bridging
  37. # and have precreated a tap0 virtual interface
  38. # and bridged it with your ethernet interface.
  39. # If you want to control access policies
  40. # over the VPN, you must create firewall
  41. # rules for the the TUN/TAP interface.
  42. # On non-Windows systems, you can give
  43. # an explicit unit number, such as tun0.
  44. # On Windows, use "dev-node" for this.
  45. # On most systems, the VPN will not function
  46. # unless you partially or fully disable
  47. # the firewall for the TUN/TAP interface.
  48. ;dev tap
  49. dev tun
  50. # Windows needs the TAP-Win32 adapter name
  51. # from the Network Connections panel if you
  52. # have more than one. On XP SP2 or higher,
  53. # you may need to selectively disable the
  54. # Windows firewall for the TAP adapter.
  55. # Non-Windows systems usually don't need this.
  56. ;dev-node MyTap
  57. # SSL/TLS root certificate (ca), certificate
  58. # (cert), and private key (key). Each client
  59. # and the server must have their own cert and
  60. # key file. The server and all clients will
  61. # use the same ca file.
  62. #
  63. # See the "easy-rsa" directory for a series
  64. # of scripts for generating RSA certificates
  65. # and private keys. Remember to use
  66. # a unique Common Name for the server
  67. # and each of the client certificates.
  68. #
  69. # Any X509 key management system can be used.
  70. # OpenVPN can also use a PKCS #12 formatted key file
  71. # (see "pkcs12" directive in man page).
  72. ca /etc/openvpn/ca.crt
  73. cert /etc/openvpn/server.crt
  74. key /etc/openvpn/server.key # This file should be kept secret
  75. # Diffie hellman parameters.
  76. # Generate your own with:
  77. # openssl dhparam -out dh2048.pem 2048
  78. dh /etc/openvpn/dh2048.pem
  79. # Network topology
  80. # Should be subnet (addressing via IP)
  81. # unless Windows clients v2.0.9 and lower have to
  82. # be supported (then net30, i.e. a /30 per client)
  83. # Defaults to net30 (not recommended)
  84. ;topology subnet
  85. # Configure server mode and supply a VPN subnet
  86. # for OpenVPN to draw client addresses from.
  87. # The server will take 10.8.0.1 for itself,
  88. # the rest will be made available to clients.
  89. # Each client will be able to reach the server
  90. # on 10.8.0.1. Comment this line out if you are
  91. # ethernet bridging. See the man page for more info.
  92. server 192.168.1.0 255.255.255.0
  93. # Maintain a record of client <-> virtual IP address
  94. # associations in this file. If OpenVPN goes down or
  95. # is restarted, reconnecting clients can be assigned
  96. # the same virtual IP address from the pool that was
  97. # previously assigned.
  98. ifconfig-pool-persist ipp.txt
  99. # Configure server mode for ethernet bridging.
  100. # You must first use your OS's bridging capability
  101. # to bridge the TAP interface with the ethernet
  102. # NIC interface. Then you must manually set the
  103. # IP/netmask on the bridge interface, here we
  104. # assume 10.8.0.4/255.255.255.0. Finally we
  105. # must set aside an IP range in this subnet
  106. # (start=10.8.0.50 end=10.8.0.100) to allocate
  107. # to connecting clients. Leave this line commented
  108. # out unless you are ethernet bridging.
  109. ;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
  110. # Configure server mode for ethernet bridging
  111. # using a DHCP-proxy, where clients talk
  112. # to the OpenVPN server-side DHCP server
  113. # to receive their IP address allocation
  114. # and DNS server addresses. You must first use
  115. # your OS's bridging capability to bridge the TAP
  116. # interface with the ethernet NIC interface.
  117. # Note: this mode only works on clients (such as
  118. # Windows), where the client-side TAP adapter is
  119. # bound to a DHCP client.
  120. ;server-bridge
  121. # Push routes to the client to allow it
  122. # to reach other private subnets behind
  123. # the server. Remember that these
  124. # private subnets will also need
  125. # to know to route the OpenVPN client
  126. # address pool (10.8.0.0/255.255.255.0)
  127. # back to the OpenVPN server.
  128. ;push "route 192.168.10.0 255.255.255.0"
  129. ;push "route 192.168.20.0 255.255.255.0"
  130. # To assign specific IP addresses to specific
  131. # clients or if a connecting client has a private
  132. # subnet behind it that should also have VPN access,
  133. # use the subdirectory "ccd" for client-specific
  134. # configuration files (see man page for more info).
  135. # EXAMPLE: Suppose the client
  136. # having the certificate common name "Thelonious"
  137. # also has a small subnet behind his connecting
  138. # machine, such as 192.168.40.128/255.255.255.248.
  139. # First, uncomment out these lines:
  140. ;client-config-dir ccd
  141. ;route 192.168.40.128 255.255.255.248
  142. # Then create a file ccd/Thelonious with this line:
  143. # iroute 192.168.40.128 255.255.255.248
  144. # This will allow Thelonious' private subnet to
  145. # access the VPN. This example will only work
  146. # if you are routing, not bridging, i.e. you are
  147. # using "dev tun" and "server" directives.
  148. # EXAMPLE: Suppose you want to give
  149. # Thelonious a fixed VPN IP address of 10.9.0.1.
  150. # First uncomment out these lines:
  151. ;client-config-dir ccd
  152. ;route 10.9.0.0 255.255.255.252
  153. # Then add this line to ccd/Thelonious:
  154. # ifconfig-push 10.9.0.1 10.9.0.2
  155. # Suppose that you want to enable different
  156. # firewall access policies for different groups
  157. # of clients. There are two methods:
  158. # (1) Run multiple OpenVPN daemons, one for each
  159. # group, and firewall the TUN/TAP interface
  160. # for each group/daemon appropriately.
  161. # (2) (Advanced) Create a script to dynamically
  162. # modify the firewall in response to access
  163. # from different clients. See man
  164. # page for more info on learn-address script.
  165. ;learn-address ./script
  166. # If enabled, this directive will configure
  167. # all clients to redirect their default
  168. # network gateway through the VPN, causing
  169. # all IP traffic such as web browsing and
  170. # and DNS lookups to go through the VPN
  171. # (The OpenVPN server machine may need to NAT
  172. # or bridge the TUN/TAP interface to the internet
  173. # in order for this to work properly).
  174. push "redirect-gateway def1 bypass-dhcp"
  175. # Certain Windows-specific network settings
  176. # can be pushed to clients, such as DNS
  177. # or WINS server addresses. CAVEAT:
  178. # http://openvpn.net/faq.html#dhcpcaveats
  179. # The addresses below refer to the public
  180. # DNS servers provided by opendns.com.
  181. push "dhcp-option DNS 114.114.114.114"
  182. push "dhcp-option DNS 8.8.8.8"
  183. # Uncomment this directive to allow different
  184. # clients to be able to "see" each other.
  185. # By default, clients will only see the server.
  186. # To force clients to only see the server, you
  187. # will also need to appropriately firewall the
  188. # server's TUN/TAP interface.
  189. client-to-client
  190. # Uncomment this directive if multiple clients
  191. # might connect with the same certificate/key
  192. # files or common names. This is recommended
  193. # only for testing purposes. For production use,
  194. # each client should have its own certificate/key
  195. # pair.
  196. #
  197. # IF YOU HAVE NOT GENERATED INDIVIDUAL
  198. # CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
  199. # EACH HAVING ITS OWN UNIQUE "COMMON NAME",
  200. # UNCOMMENT THIS LINE OUT.
  201. duplicate-cn
  202. # The keepalive directive causes ping-like
  203. # messages to be sent back and forth over
  204. # the link so that each side knows when
  205. # the other side has gone down.
  206. # Ping every 10 seconds, assume that remote
  207. # peer is down if no ping received during
  208. # a 120 second time period.
  209. keepalive 10 120
  210. # For extra security beyond that provided
  211. # by SSL/TLS, create an "HMAC firewall"
  212. # to help block DoS attacks and UDP port flooding.
  213. #
  214. # Generate with:
  215. # openvpn --genkey --secret ta.key
  216. #
  217. # The server and each client must have
  218. # a copy of this key.
  219. # The second parameter should be '0'
  220. # on the server and '1' on the clients.
  221. ;tls-auth ta.key 0 # This file is secret
  222. # Select a cryptographic cipher.
  223. # This config item must be copied to
  224. # the client config file as well.
  225. ;cipher BF-CBC # Blowfish (default)
  226. ;cipher AES-128-CBC # AES
  227. ;cipher DES-EDE3-CBC # Triple-DES
  228. # Enable compression on the VPN link.
  229. # If you enable it here, you must also
  230. # enable it in the client config file.
  231. comp-lzo
  232. # The maximum number of concurrently connected
  233. # clients we want to allow.
  234. ;max-clients 100
  235. # It's a good idea to reduce the OpenVPN
  236. # daemon's privileges after initialization.
  237. #
  238. # You can uncomment this out on
  239. # non-Windows systems.
  240. user nobody
  241. group nogroup
  242. # The persist options will try to avoid
  243. # accessing certain resources on restart
  244. # that may no longer be accessible because
  245. # of the privilege downgrade.
  246. persist-key
  247. persist-tun
  248. # Output a short status file showing
  249. # current connections, truncated
  250. # and rewritten every minute.
  251. status openvpn-status.log
  252. # By default, log messages will go to the syslog (or
  253. # on Windows, if running as a service, they will go to
  254. # the "\Program Files\OpenVPN\log" directory).
  255. # Use log or log-append to override this default.
  256. # "log" will truncate the log file on OpenVPN startup,
  257. # while "log-append" will append to it. Use one
  258. # or the other (but not both).
  259. log /var/log/openvpn.log
  260. log-append /var/log/openvpn.log
  261. # Set the appropriate level of log
  262. # file verbosity.
  263. #
  264. # 0 is silent, except for fatal errors
  265. # 4 is reasonable for general usage
  266. # 5 and 6 can help to debug connection problems
  267. # 9 is extremely verbose
  268. verb 3
  269. # Silence repeating messages. At most 20
  270. # sequential messages of the same message
  271. # category will be output to the log.
  272. ;mute 20
COPY

server 192.168.1.0 255.255.255.0

这行可以根据期望分配的ip段进行相应修改。

0x03 开启iptables的NAT功能

开启ip数据包转发

修改/etc/sysctl.conf文件,去掉#net.ipv4.ip_forward=1前面的#,并保存

sysctl –p

这样就开启了ip数据包转发功能,从而支持在多个网卡间转发数据。

配置NAT转发规则

iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE

将所有来自VPN网段的数据都转发到eth0网卡,并修改源ip为eth0的网卡ip。

开启防火墙策略

iptables -A INPUT -p UDP –dport 1194 -j ACCEPT

此外,还要在腾讯云的云主机控制台中增加入站规则。

0x04 开启服务

systemctl start openvpn@server
systemctl enable openvpn@server

0x05 测试OpenVPN客户端

下载Windows版的OpenVPN安装程序,安装到系统中。

将前面生成的ca.crt、client.crt、client.key三个文件拷贝到电脑中,如:D:\openvpn目录。

将安装目录下sample-config目录中的client.ovpn文件拷贝到config目录下,并修改服务端ip和证书路径配置。

修改后的client.ovpn内容如下:

  1. ##############################################
  2. # Sample client-side OpenVPN 2.0 config file #
  3. # for connecting to multi-client server. #
  4. # #
  5. # This configuration can be used by multiple #
  6. # clients, however each client should have #
  7. # its own cert and key files. #
  8. # #
  9. # On Windows, you might want to rename this #
  10. # file so it has a .ovpn extension #
  11. ##############################################
  12. # Specify that we are a client and that we
  13. # will be pulling certain config file directives
  14. # from the server.
  15. client
  16. # Use the same setting as you are using on
  17. # the server.
  18. # On most systems, the VPN will not function
  19. # unless you partially or fully disable
  20. # the firewall for the TUN/TAP interface.
  21. ;dev tap
  22. dev tun
  23. # Windows needs the TAP-Win32 adapter name
  24. # from the Network Connections panel
  25. # if you have more than one. On XP SP2,
  26. # you may need to disable the firewall
  27. # for the TAP adapter.
  28. ;dev-node MyTap
  29. # Are we connecting to a TCP or
  30. # UDP server? Use the same setting as
  31. # on the server.
  32. ;proto tcp
  33. proto udp
  34. # The hostname/IP and port of the server.
  35. # You can have multiple remote entries
  36. # to load balance between the servers.
  37. remote 1.2.3.4 1194
  38. ;remote my-server-2 1194
  39. # Choose a random host from the remote
  40. # list for load-balancing. Otherwise
  41. # try hosts in the order specified.
  42. ;remote-random
  43. # Keep trying indefinitely to resolve the
  44. # host name of the OpenVPN server. Very useful
  45. # on machines which are not permanently connected
  46. # to the internet such as laptops.
  47. resolv-retry infinite
  48. # Most clients don't need to bind to
  49. # a specific local port number.
  50. nobind
  51. # Downgrade privileges after initialization (non-Windows only)
  52. ;user nobody
  53. ;group nobody
  54. # Try to preserve some state across restarts.
  55. persist-key
  56. persist-tun
  57. # If you are connecting through an
  58. # HTTP proxy to reach the actual OpenVPN
  59. # server, put the proxy server/IP and
  60. # port number here. See the man page
  61. # if your proxy server requires
  62. # authentication.
  63. ;http-proxy-retry # retry on connection failures
  64. ;http-proxy [proxy server] [proxy port #]
  65. # Wireless networks often produce a lot
  66. # of duplicate packets. Set this flag
  67. # to silence duplicate packet warnings.
  68. ;mute-replay-warnings
  69. # SSL/TLS parms.
  70. # See the server config file for more
  71. # description. It's best to use
  72. # a separate .crt/.key file pair
  73. # for each client. A single ca
  74. # file can be used for all clients.
  75. ca D:\\openvpn\\ca.crt
  76. cert D:\\openvpn\\client.crt
  77. key D:\\openvpn\\client.key
  78. # Verify server certificate by checking that the
  79. # certicate has the correct key usage set.
  80. # This is an important precaution to protect against
  81. # a potential attack discussed here:
  82. # http://openvpn.net/howto.html#mitm
  83. #
  84. # To use this feature, you will need to generate
  85. # your server certificates with the keyUsage set to
  86. # digitalSignature, keyEncipherment
  87. # and the extendedKeyUsage to
  88. # serverAuth
  89. # EasyRSA can do this for you.
  90. remote-cert-tls server
  91. # If a tls-auth key is used on the server
  92. # then every client must also have the key.
  93. ;tls-auth ta.key 1
  94. # Select a cryptographic cipher.
  95. # If the cipher option is used on the server
  96. # then you must also specify it here.
  97. ;cipher x
  98. # Enable compression on the VPN link.
  99. # Don't enable this unless it is also
  100. # enabled in the server config file.
  101. comp-lzo
  102. # Set log file verbosity.
  103. verb 3
  104. # Silence repeating messages
  105. ;mute 20
COPY

还有一种把证书插入到ovpn文件中的写法,这样可以不用额外提供三个证书文件。

去掉client.ovpn文件中的以下三行:

ca D:\openvpn\ca.crt
cert D:\openvpn\client.crt
key D:\openvpn\client.key

并在文件末尾加入以下内容:

  1. ###############################################################################
  2. # The certificate file of the destination VPN Server.
  3. #
  4. # The CA certificate file is embedded in the inline format.
  5. # You can replace this CA contents if necessary.
  6. # Please note that if the server certificate is not a self-signed, you have to
  7. # specify the signer's root certificate (CA) here.
  8. <ca>
  9. -----BEGIN CERTIFICATE-----
  10. MIIDAzCCAeugAwIBAgIEEUA4CTANBgkqhkiG9w0BAQsFADA5MRMwEQYDVQQDDAo0
  11. NzFiY2p5LmpwMRUwEwYDVQQKDAxudTU4NW92IHIxaGwxCzAJBgNVBAYTAlVTMB4X
  12. DTE2MDIyOTAyNDQxNloXDTIzMDQyMDAyNDQxNlowOTETMBEGA1UEAwwKNDcxYmNq
  13. eS5qcDEVMBMGA1UECgwMbnU1ODVvdiByMWhsMQswCQYDVQQGEwJVUzCCASIwDQYJ
  14. KoZIhvcNAQEBBQADggEPADCCAQoCggEBAPLuy9Hppm1GGFOtpuMJ3fcj1RsHxoMc
  15. Enr721gq8eYOsddULlMRv5IJMIQZb+8g0mmcZAw4x7Rl3YCptopjrVDDYDl4Ul3y
  16. OwG1EfKJiqGlXM5asdMgk6tU/oB7RMGtjLzVcNSOge24+PigrsRQLS3WcEHX0q6F
  17. WdsvPVnbUzceoug/l+zkA8IVf2eFna9x0WldwjLqJAbcL6YILSKHTpHw40yl44+R
  18. /LBNNVvuUWyVm8FReMbQf0tkRqvl+ZRlpnb3pQ68FWhXfwE9nZD/hbbjcmgf9bMg
  19. cEDI72pCqlw00QodnhwPQJVnhRFQr1u7aMEdXyBzGpdfdOY8GAPP2KkCAwEAAaMT
  20. MBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAOG1qYZLpLhmr
  21. WJMMht7ktkWtLD33DUjimS0hj3Z90JsHE/Vwlqi4c+AQUtw2dX/ZfGTRj83aK/cA
  22. GGQ5lW4HudNi6yCr40Ekl7EVeNAUQ+DM8TpAgYq8Hr/qVDGZDCxu61iaR/Qugh4P
  23. qM4YHLlJO140WXto0w3T4SkDGbIsiJnCsUOMzjStRIhKyXl+K62ozuuZAAW6vRTe
  24. kxz9+IHYc/kbAwoU009u+V11mtIzGvJaXhx95YaZX1nkqbH03pdgb4TcG41nXEmE
  25. t7BXXGira4UJmLD8t7VK0LRlmZ+9X2NB5URima6yB23UAILDIX4371QFDvbo8px5
  26. Cym58IyGLA==
  27. -----END CERTIFICATE-----
  28. </ca>
  29. ###############################################################################
  30. # The client certificate file (dummy).
  31. #
  32. # In some implementations of OpenVPN Client software
  33. # (for example: OpenVPN Client for iOS),
  34. # a pair of client certificate and private key must be included on the
  35. # configuration file due to the limitation of the client.
  36. # So this sample configuration file has a dummy pair of client certificate
  37. # and private key as follows.
  38. <cert>
  39. -----BEGIN CERTIFICATE-----
  40. MIICxjCCAa4CAQAwDQYJKoZIhvcNAQEFBQAwKTEaMBgGA1UEAxMRVlBOR2F0ZUNs
  41. aWVudENlcnQxCzAJBgNVBAYTAkpQMB4XDTEzMDIxMTAzNDk0OVoXDTM3MDExOTAz
  42. MTQwN1owKTEaMBgGA1UEAxMRVlBOR2F0ZUNsaWVudENlcnQxCzAJBgNVBAYTAkpQ
  43. MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5h2lgQQYUjwoKYJbzVZA
  44. 5VcIGd5otPc/qZRMt0KItCFA0s9RwReNVa9fDRFLRBhcITOlv3FBcW3E8h1Us7RD
  45. 4W8GmJe8zapJnLsD39OSMRCzZJnczW4OCH1PZRZWKqDtjlNca9AF8a65jTmlDxCQ
  46. CjntLIWk5OLLVkFt9/tScc1GDtci55ofhaNAYMPiH7V8+1g66pGHXAoWK6AQVH67
  47. XCKJnGB5nlQ+HsMYPV/O49Ld91ZN/2tHkcaLLyNtywxVPRSsRh480jju0fcCsv6h
  48. p/0yXnTB//mWutBGpdUlIbwiITbAmrsbYnjigRvnPqX1RNJUbi9Fp6C2c/HIFJGD
  49. ywIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQChO5hgcw/4oWfoEFLu9kBa1B//kxH8
  50. hQkChVNn8BRC7Y0URQitPl3DKEed9URBDdg2KOAz77bb6ENPiliD+a38UJHIRMqe
  51. UBHhllOHIzvDhHFbaovALBQceeBzdkQxsKQESKmQmR832950UCovoyRB61UyAV7h
  52. +mZhYPGRKXKSJI6s0Egg/Cri+Cwk4bjJfrb5hVse11yh4D9MHhwSfCOH+0z4hPUT
  53. Fku7dGavURO5SVxMn/sL6En5D+oSeXkadHpDs+Airym2YHh15h0+jPSOoR6yiVp/
  54. 6zZeZkrN43kuS73KpKDFjfFPh8t4r1gOIjttkNcQqBccusnplQ7HJpsk
  55. -----END CERTIFICATE-----
  56. </cert>
  57. <key>
  58. -----BEGIN RSA PRIVATE KEY-----
  59. MIIEpAIBAAKCAQEA5h2lgQQYUjwoKYJbzVZA5VcIGd5otPc/qZRMt0KItCFA0s9R
  60. wReNVa9fDRFLRBhcITOlv3FBcW3E8h1Us7RD4W8GmJe8zapJnLsD39OSMRCzZJnc
  61. zW4OCH1PZRZWKqDtjlNca9AF8a65jTmlDxCQCjntLIWk5OLLVkFt9/tScc1GDtci
  62. 55ofhaNAYMPiH7V8+1g66pGHXAoWK6AQVH67XCKJnGB5nlQ+HsMYPV/O49Ld91ZN
  63. /2tHkcaLLyNtywxVPRSsRh480jju0fcCsv6hp/0yXnTB//mWutBGpdUlIbwiITbA
  64. mrsbYnjigRvnPqX1RNJUbi9Fp6C2c/HIFJGDywIDAQABAoIBAERV7X5AvxA8uRiK
  65. k8SIpsD0dX1pJOMIwakUVyvc4EfN0DhKRNb4rYoSiEGTLyzLpyBc/A28Dlkm5eOY
  66. fjzXfYkGtYi/Ftxkg3O9vcrMQ4+6i+uGHaIL2rL+s4MrfO8v1xv6+Wky33EEGCou
  67. QiwVGRFQXnRoQ62NBCFbUNLhmXwdj1akZzLU4p5R4zA3QhdxwEIatVLt0+7owLQ3
  68. lP8sfXhppPOXjTqMD4QkYwzPAa8/zF7acn4kryrUP7Q6PAfd0zEVqNy9ZCZ9ffho
  69. zXedFj486IFoc5gnTp2N6jsnVj4LCGIhlVHlYGozKKFqJcQVGsHCqq1oz2zjW6LS
  70. oRYIHgECgYEA8zZrkCwNYSXJuODJ3m/hOLVxcxgJuwXoiErWd0E42vPanjjVMhnt
  71. KY5l8qGMJ6FhK9LYx2qCrf/E0XtUAZ2wVq3ORTyGnsMWre9tLYs55X+ZN10Tc75z
  72. 4hacbU0hqKN1HiDmsMRY3/2NaZHoy7MKnwJJBaG48l9CCTlVwMHocIECgYEA8jby
  73. dGjxTH+6XHWNizb5SRbZxAnyEeJeRwTMh0gGzwGPpH/sZYGzyu0SySXWCnZh3Rgq
  74. 5uLlNxtrXrljZlyi2nQdQgsq2YrWUs0+zgU+22uQsZpSAftmhVrtvet6MjVjbByY
  75. DADciEVUdJYIXk+qnFUJyeroLIkTj7WYKZ6RjksCgYBoCFIwRDeg42oK89RFmnOr
  76. LymNAq4+2oMhsWlVb4ejWIWeAk9nc+GXUfrXszRhS01mUnU5r5ygUvRcarV/T3U7
  77. TnMZ+I7Y4DgWRIDd51znhxIBtYV5j/C/t85HjqOkH+8b6RTkbchaX3mau7fpUfds
  78. Fq0nhIq42fhEO8srfYYwgQKBgQCyhi1N/8taRwpk+3/IDEzQwjbfdzUkWWSDk9Xs
  79. H/pkuRHWfTMP3flWqEYgW/LW40peW2HDq5imdV8+AgZxe/XMbaji9Lgwf1RY005n
  80. KxaZQz7yqHupWlLGF68DPHxkZVVSagDnV/sztWX6SFsCqFVnxIXifXGC4cW5Nm9g
  81. va8q4QKBgQCEhLVeUfdwKvkZ94g/GFz731Z2hrdVhgMZaU/u6t0V95+YezPNCQZB
  82. wmE9Mmlbq1emDeROivjCfoGhR3kZXW1pTKlLh6ZMUQUOpptdXva8XxfoqQwa3enA
  83. M7muBbF0XN7VO80iJPv+PmIZdEIAkpwKfi201YB+BafCIuGxIF50Vg==
  84. -----END RSA PRIVATE KEY-----
  85. </key>
COPY

请根据具体服务器配置修改对应的内容。

打开OpenVPN GUI,选择刚才添加的配置项,进行连接。连接成功后,图标会从灰色变成绿色。

分享
0 comments
Anonymous
Markdown is supported

Be the first guy leaving a comment!