############################################################# # 以下为修改配置文件内容 ############################################################# # # SSL/TLS root certificate (ca), certificate # (cert), and private key (key). Each client # and the server must have their own cert and # key file. The server and all clients will # use the same ca file. # # See the "easy-rsa" directory for a series # of scripts for generating RSA certificates # and private keys. Remember to use # a unique Common Name for the server # and each of the client certificates. # # Any X509 key management system can be used. # OpenVPN can also use a PKCS #12 formatted key file # (see "pkcs12" directive in man page). ca ca.crt cert server.crt key server.key # This file should be kept secret
# Diffie hellman parameters. # Generate your own with: # openssl dhparam -out dh2048.pem 2048 dh dh.pem # 以上配置内容修改为证书生成所对应的文件名及路径,服务端识别的相对路径为 `/etc/openvpn`
# Push routes to the client to allow it # to reach other private subnets behind # the server. Remember that these # private subnets will also need # to know to route the OpenVPN client # address pool (10.8.0.0/255.255.255.0) # back to the OpenVPN server. push "route 172.16.1.0 255.255.255.0" push "route 192.168.1.0 255.255.255.0" # 推送路由信息给客户端以找到 VPN 背后的子网
# Select a cryptographic cipher. # This config item must be copied to # the client config file as well. # Note that v2.4 client/server will automatically # negotiate AES-256-GCM in TLS mode. # See also the ncp-cipher option in the manpage cipher AES-256-GCM # 原:AES-256-CBC # 修改为安全性更高的加密方式
############################################################# # 以下为修改配置文件内容 ############################################################# # The hostname/IP and port of the server. # You can have multiple remote entries # to load balance between the servers. remote my-server-1 1194 ;remote my-server-2 1194 # 修改服务器监听地址
# # 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 ca.crt cert client.crt key client.key
# 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 v2.4 client/server will automatically # negotiate AES-256-GCM in TLS mode. # See also the ncp-cipher option in the manpage cipher AES-256-GCM # 修改加密方式