云服务器内容精选

  • 数据规划 表1 规划数据 类别 规划项 规划值 VPC 待互通子网 192.168.0.0/16 VPN网关 互联子网 用于VPN网关和VPC通信,请确保选择的互联子网存在3个及以上可分配的IP地址。 192.168.2.0/24 已创建/剩余连接数 0/10 EIP地址 EIP地址在购买EIP时由系统自动生成。 本示例假设EIP地址生成如下:11.xx.xx.11 服务端 本端网段 192.168.1.0/24 服务端证书 cert-server(使用 云证书管理服务 托管的服务端证书名称) SSL参数 协议:TCP 端口:443 加密算法:AES-128-GCM 认证算法:SHA256 是否压缩:否 客户端 客户端网段 172.16.0.0/16 客户端认证类型 默认选择“口令认证(本地)”。 用户组 名称:Testgroup_01 用户 名称:Test_01 密码:请根据实际配置 所属用户组:Testgroup_01 访问策略 名称:Policy_01 目的网段:192.168.1.0/24 用户组:Testgroup_01
  • 操作流程 通过VPN实现客户端远程接入VPC的操作流程如图 操作流程所示。 图1 操作流程 表2 操作流程说明 序号 步骤 说明 1 步骤一:创建VPN网关 VPN网关需要绑定EIP作为出口公网IP。 如果您已经购买EIP,则此处可以直接绑定使用。 2 步骤二:配置服务端 指定客户端需要访问的网段(本端网段)和客户端访问时使用的网段(客户端网段)。 选择服务端证书和客户端认证类型,用于建立VPN连接时的身份认证。 客户端认证类型支持“证书认证”和“口令认证(本地)”两种方式。 配置VPN连接的SSL参数(协议、端口、认证算法、加密算法等)。 3 步骤三:配置客户端 从控制台下载客户端配置,对配置文件进行修改后导入对应的VPN客户端软件。 4 步骤四:验证连通性 打开客户端设备的命令行窗口,执行ping命令,验证连通性。
  • 结果验证 打开客户端设备的命令行窗口。 执行命令:ping 192.168.1.10,验证连通性。 其中,192.168.1.10为客户端需要访问的弹性云服务器的IP地址,请根据实际替换。 回显如下信息,表示网络已通。 来自 xx.xx.xx.xx 的回复: 字节=32 时间=28ms TTL=245 来自 xx.xx.xx.xx 的回复: 字节=32 时间=28ms TTL=245 来自 xx.xx.xx.xx 的回复: 字节=32 时间=28ms TTL=245 来自 xx.xx.xx.xx 的回复: 字节=32 时间=27ms TTL=245
  • 操作步骤 根据Windows操作系统下载Easy-RSA安装包至“D:\”目录下。 Windows 32位操作系统,可以下载EasyRSA-3.1.7-win32.zip。 Windows 64位操作系统,可以下载EasyRSA-3.1.7-win64.zip。 此处以安装EasyRSA-3.1.7-win64为示例。 解压缩“EasyRSA-3.1.7-win64.zip”至指定目录,如“D:\EasyRSA-3.1.7”。 进入“D:\EasyRSA-3.1.7”目录。 在地址栏中输入cmd并按回车键,打开命令行窗口。 执行“.\EasyRSA-Start.bat”命令,运行Easy-RSA。 系统显示如下类似信息: Welcome to the EasyRSA 3 Shell for Windows. Easy-RSA 3 is available under a GNU GPLv2 license. Invoke './easyrsa' to call the program. Without commands, help is displayed. EasyRSA Shell # 执行“./easyrsa init-pki”命令,初始化PKI环境。 系统显示如下类似信息: Notice ------ 'init-pki' complete; you may now create a CA or requests. Your newly created PKI dir is: * D:/EasyRSA-3.1.7/pki Using Easy-RSA configuration: * undefined EasyRSA Shell # 执行命令后,在“D:\EasyRSA-3.1.7”的目录下自动生成了“pki”的文件夹。 配置变量参数。 将“D:\EasyRSA-3.1.7”目录下的“vars.example”文件复制到“D:\EasyRSA-3.1.7\pki”目录下。 将“D:\EasyRSA-3.1.7\pki”目录下的“vars.example”重命名为“vars”。 默认按“vars.example”中描述的参数值进行配置。如需自定义参数值,按需设置“vars”文件的参数值。 生成服务端CA证书认证及其私钥。 复制解压缩后的“EasyRSA-3.1.7”文件夹至“D:\”目录下,并重命名,如“EasyRSA-3.1.7 - server”。 进入“D:\EasyRSA-3.1.7 - server”目录。 在“D:\EasyRSA-3.1.7 - server”的文件夹中,地址栏中输入cmd并按回车键,打开命令行窗口。 执行“.\EasyRSA-Start.bat”命令,运行Easy-RSA。 系统显示如下类似信息: Welcome to the EasyRSA 3 Shell for Windows. Easy-RSA 3 is available under a GNU GPLv2 license. Invoke './easyrsa' to call the program. Without commands, help is displayed. EasyRSA Shell # 执行“./easyrsa build-ca nopass”命令,生成CA证书。 此命令生成中,[Easy-RSA CA]需要设置服务端CA证书名称,例如:p2cvpn_server.com。 系统显示如下类似信息: Using Easy-RSA 'vars' configuration: * D:/EasyRSA-3.1.7 - server/pki/vars Using SSL: * openssl OpenSSL 3.1.2 1 Aug 2023 (Library: OpenSSL 3.1.2 1 Aug 2023) ..+.....+...+..........+..+.......+..+..........+...+...+..+......+.......+...+++++++++++++++++++++++++++++++++++++++*.+++++++++++++++++++++++++++++++++++++++*..........+...........+...+......++++++ .......+.......+...+......+...+.....+...+...+++++++++++++++++++++++++++++++++++++++*......+.....+....+..+....+......+...+......+...+......+.....+.+++++++++++++++++++++++++++++++++++++++*.......+......+.......+..............+.+...+.....+....+........+.........+....+..+............+.+.....+....+...+...+...........+.+..+.+.........+.....+...+..................+.......+..+.......+.....+..........+......+..+.+.....+.+.....+....+.....+.......+...+.........+..+......+...+.......+...+.........+......+......+...........+....+......+...+..+...+......+...+.+.....+.......+..+.......+...+...+..+.............+........+.........+.+.........+........+....+.........+.....+.........+................+.....+.+........+.......+.....+.+........+....+..+...+..........+..+......+...+.........+................+......+.....+....+......+......+............+..+......+...+.......+.................+.+......+......+..+.+...........+.........+.........+.+......++++++ ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Common Name (eg: your user, host, or server name) [Easy-RSA CA]:p2cvpn_server.com //设置服务端CA证书名称 Notice ------ CA creation complete. Your new CA certificate is at: * D:/EasyRSA-3.1.7 - server/pki/ca.crt EasyRSA Shell # 查看服务端CA证书及其私钥。 生成的CA证书默认存放在“D:\EasyRSA-3.1.7 - server\pki”目录下。 本示例中生成的证书为“ca.crt”。 生成的CA私钥默认存放在“D:\EasyRSA-3.1.7 - server\pki\private”目录下。 本示例中生成的私钥为“ca.key”。 执行 “./easyrsa build-server-full p2cserver.com nopass”命令,生成服务端证书及其私钥。 此命令中,“p2cserver.com”为服务端证书的CN,必须是 域名 格式,否则无法正常托管到 云证书管理 服务。请根据实际填写。 系统显示如下类似信息: Using Easy-RSA 'vars' configuration: * D:/EasyRSA-3.1.7 - server/pki/vars Using SSL: * openssl OpenSSL 3.1.2 1 Aug 2023 (Library: OpenSSL 3.1.2 1 Aug 2023) .+.+......+...+.....+......+...+.......+.....+.+...+..+...+....+.....+......+++++++++++++++++++++++++++++++++++++++*....+..+....+++++++++++++++++++++++++++++++++++++++*................+.......+..+.+..+...+......+.............+...+...+.........+........+.........+...+......+.+...+...+........+....+.....+.+............+.....+...+....+...........+....+..+......+.............+.........+........+...+.+......+.....+.......+......+.....+.+.....+....+.........+...+..+............+.+........+.........+.+..+.........+......+...+....+......+.....+....+......+.....+......+.............+...+........+.+.....+.+....................+.......+.....+.+..+.......+...++++++ ......+.....+...+.+.........+..+.+..+...+++++++++++++++++++++++++++++++++++++++*.......+...+........+....+...+..+...+++++++++++++++++++++++++++++++++++++++*..+.........+...+.......+......+.................+...+...+............+...+....+........+.........+..........+......+...+...........+.+..+............+.+........+....+...........+....+...........+......+.............+......+.....++++++ ----- Notice ------ Private-Key and Public-Certificate-Request files created. Your files are: * req: D:/EasyRSA-3.1.7 - server/pki/reqs/p2cserver.com.req * key: D:/EasyRSA-3.1.7 - server/pki/private/p2cserver.com.key You are about to sign the following certificate: Request subject, to be signed as a server certificate for '825' days: subject= commonName = p2cserver.com Type the word 'yes' to continue, or any other input to abort. Confirm request details: yes //输入“yes”以继续 Using configuration from D:/EasyRSA-3.1.7 - server/pki/openssl-easyrsa.cnf Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows commonName :ASN.1 12:'p2cserver.com' Certificate is to be certified until Oct 6 03:28:14 2026 GMT (825 days) Write out database with 1 new entries Database updated Notice ------ Certificate created at: * D:/EasyRSA-3.1.7 - server/pki/issued/p2cserver.com.crt Notice ------ Inline file created: * D:/EasyRSA-3.1.7 - server/pki/inline/p2cserver.com.inline EasyRSA Shell # 查看服务端证书及其私钥。 生成的服务端证书默认存放在“D:\EasyRSA-3.1.7 - server\pki\issued”目录下的“issued”文件夹中。 本示例中生成的证书为“p2cserver.com.crt”。 生成的服务端私钥默认存放在“D:\EasyRSA-3.1.7 - server\pki\private”目录下的“private”文件夹中。 本示例中生成的私钥为“p2cserver.com.key”。 生成客户端CA证书认证及其私钥。 复制解压缩后的“EasyRSA-3.1.7”文件夹至“D:\”目录下,并重命名,如“EasyRSA-3.1.7 - client” 进入“EasyRSA-3.1.7 - client”目录。 在“EasyRSA-3.1.7 - client”的文件夹中,地址栏中输入cmd并按回车键,打开命令行窗口。 执行“.\EasyRSA-Start.bat”命令,运行Easy-RSA。 系统显示如下类似信息: Welcome to the EasyRSA 3 Shell for Windows. Easy-RSA 3 is available under a GNU GPLv2 license. Invoke './easyrsa' to call the program. Without commands, help is displayed. EasyRSA Shell # 执行“ ./easyrsa build-ca nopass”命令,生成CA证书。 系统显示如下类似信息: Using Easy-RSA 'vars' configuration: * D:/EasyRSA-3.1.7 - client/pki/vars Using SSL: * openssl OpenSSL 3.1.2 1 Aug 2023 (Library: OpenSSL 3.1.2 1 Aug 2023) .+++++++++++++++++++++++++++++++++++++++*.....+.+..+...+....+.....................+..+...+....+.........+.....+......+.+.....+....+++++++++++++++++++++++++++++++++++++++*....+...+...+...+............+.........++++++ .+.........+.........+.+......+...........+....+.....+.........+....+..+...+.+.........+......+......+...+.....+......+......+..........+++++++++++++++++++++++++++++++++++++++*.+.........+......+.+++++++++++++++++++++++++++++++++++++++*...........+................+..............+.........+.+...+.....................+..+....+.....+..........+...+...+..+.++++++ ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Common Name (eg: your user, host, or server name) [Easy-RSA CA]:p2cvpn_client.com //设置客户端CA证书名称 Notice ------ CA creation complete. Your new CA certificate is at: * D:/EasyRSA-3.1.7 - client/pki/ca.crt EasyRSA Shell # 查看客户端CA证书及其私钥。 生成的CA证书默认存放在“D:\EasyRSA-3.1.7 - client\pki”目录下。 本示例中生成的证书为“ca.crt”。 生成的CA私钥默认存放在“D:\EasyRSA-3.1.7 - client\pki\private”目录下。 本示例中生成的私钥为“ca.key”。 执行“./easyrsa build-client-full p2cclient.com nopass”命令,生成客户端证书及其私钥。 此命令中,客户端证书的命名(如“p2cclient.com”)应与服务端证书的命名(如“p2cserver.com”)不一致。 系统显示如下类似信息: Using Easy-RSA 'vars' configuration: * D:/EasyRSA-3.1.7 - client/pki/vars Using SSL: * openssl OpenSSL 3.1.2 1 Aug 2023 (Library: OpenSSL 3.1.2 1 Aug 2023) .+++++++++++++++++++++++++++++++++++++++*.........+.....+...+.+........+.+.....+.........+.+......+.....+++++++++++++++++++++++++++++++++++++++*..........+...+...+..+.......+...+..+.+.........+.....+.+..+.+....................+......+...............+.............+......+..+....+...+......+..+....+.....+.........+................+...+...+.....+....+.........++++++ .+..+..........+.........+++++++++++++++++++++++++++++++++++++++*...+..+++++++++++++++++++++++++++++++++++++++*.......+...............+......+.........+..............+....+.....+...+..................+....+...+........+....+.....+.+.....+...............++++++ ----- Notice ------ Private-Key and Public-Certificate-Request files created. Your files are: * req: D:/EasyRSA-3.1.7 - client/pki/reqs/p2cclient.com.req * key: D:/EasyRSA-3.1.7 - client/pki/private/p2cclient.com.key You are about to sign the following certificate: Request subject, to be signed as a client certificate for '825' days: subject= commonName = p2cclient.com Type the word 'yes' to continue, or any other input to abort. Confirm request details: yes Using configuration from D:/EasyRSA-3.1.7 - client/pki/openssl-easyrsa.cnf Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows commonName :ASN.1 12:'p2cclient.com' Certificate is to be certified until Oct 7 11:19:52 2026 GMT (825 days) Write out database with 1 new entries Database updated Notice ------ Certificate created at: * D:/EasyRSA-3.1.7 - client/pki/issued/p2cclient.com.crt Notice ------ Inline file created: * D:/EasyRSA-3.1.7 - client/pki/inline/p2cclient.com.inline EasyRSA Shell # 查看客户端证书和私钥。 生成的客户端证书默认存放在“D:\EasyRSA-3.1.7 - client\pki\issued”目录下。 本示例中生成的证书为“p2cclient.com.crt”。 生成的客户端私钥默认存放在“D:\EasyRSA-3.1.7 - client\pki\private”目录下。 本示例中生成的私钥为“p2cclient.com.key”。
  • 操作步骤 根据Windows操作系统下载Easy-RSA安装包至“D:\”目录下。。 Windows 32位操作系统,可以下载EasyRSA-3.1.7-win32.zip。 Windows 64位操作系统,可以下载EasyRSA-3.1.7-win64.zip。 此处以安装EasyRSA-3.1.7-win64为示例。 解压缩“EasyRSA-3.1.7-win64.zip”至指定目录,如“D:\EasyRSA-3.1.7”。 进入“D:\EasyRSA-3.1.7”目录。 在地址栏中输入cmd并按回车键,打开命令行窗口。 执行“.\EasyRSA-Start.bat”命令,运行Easy-RSA。 系统显示如下类似信息: Welcome to the EasyRSA 3 Shell for Windows. Easy-RSA 3 is available under a GNU GPLv2 license. Invoke './easyrsa' to call the program. Without commands, help is displayed. EasyRSA Shell # 执行“./easyrsa init-pki”命令,初始化PKI环境。 系统显示如下类似信息: Notice ------ 'init-pki' complete; you may now create a CA or requests. Your newly created PKI dir is: * D:/EasyRSA-3.1.7/pki Using Easy-RSA configuration: * undefined EasyRSA Shell # 执行命令后,在“D:\EasyRSA-3.1.7”的目录下自动生成了“pki”的文件夹。 配置变量参数。 将“D:\EasyRSA-3.1.7”目录下的“vars.example”文件复制到“D:\EasyRSA-3.1.7\pki”目录下。 将“D:\EasyRSA-3.1.7\pki”目录下的“vars.example”重命名为“vars”。 默认按“vars.example”中描述的参数值进行配置。如需自定义参数值,按需设置“vars”文件的参数值。 执行“ ./easyrsa build-ca nopass”命令,生成CA证书。 系统显示如下类似信息: Using Easy-RSA 'vars' configuration: * D:/EasyRSA-3.1.7/pki/vars Using SSL: * openssl OpenSSL 3.1.2 1 Aug 2023 (Library: OpenSSL 3.1.2 1 Aug 2023) .....+..+.............+......+........+...+...+....+++++++++++++++++++++++++++++++++++++++*.+.+.....+..........+............+...+++++++++++++++++++++++++++++++++++++++*............+.....+......+...+....+..+..........+.....+....+...............+..+.........+.............+......+..+...+....+..+.+.........+.....+.........+....+............+...+...+.....+........................+...+.+.....+....+...+.........+...+...+...+.....+......+........................++++++ .+++++++++++++++++++++++++++++++++++++++*.........+..........+++++++++++++++++++++++++++++++++++++++*.+......++++++ ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Common Name (eg: your user, host, or server name) [Easy-RSA CA]:p2cvpn.com //设置CA证书名称 Notice ------ CA creation complete. Your new CA certificate is at: * D:/EasyRSA-3.1.7/pki/ca.crt EasyRSA Shell # 查看CA证书及其私钥。 生成的CA证书默认存放在“D:\EasyRSA-3.1.7\pki”目录下。 本示例中生成的证书为“ca.crt”。 生成的CA私钥默认存放在“D:\EasyRSA-3.1.7\pki\private”目录下。 本示例中生成的私钥为“ca.key”。 执行 “./easyrsa build-server-full p2cserver.com nopass”命令,生成服务端证书及其私钥。 此命令中,“p2cserver.com”为证书的CN,必须是域名格式,否则无法正常托管到云证书管理服务,请根据实际填写。 系统显示如下类似信息: Using Easy-RSA 'vars' configuration: * D:/EasyRSA-3.1.7/pki/vars Using SSL: * openssl OpenSSL 3.1.2 1 Aug 2023 (Library: OpenSSL 3.1.2 1 Aug 2023) .+............+........+............+............+.+...............+.....+....+....................+............+.+..+......+............+....+.........+..+.........+.+.........+..............+.........+++++++++++++++++++++++++++++++++++++++*...+......+.....+......+...+++++++++++++++++++++++++++++++++++++++*..+...+..........+......+...........+....+......+.....+....+.....+....+........+...+.......+...+..+.......+..+......+.............+..+....+......+...+.....+................+......+..+.............+..+................+.....+......+....+...........+....+.....+.........+.+..+.............+...........+..........+......+........+............+...+....+..+......+......................+.....+......+.+...+..+...+.+......+........+...+....+.....+......+....+...+..+................+..+...+.......+..+......+..........+.........+...+..+.........+......+......++++++ ........+.+......+...+......+.....+...+.+.....+.+........+......+++++++++++++++++++++++++++++++++++++++*...+.....+...+.+.........+......+........+++++++++++++++++++++++++++++++++++++++*......+........+.+...+.....+.+..............+.+.....+.+...+...+.....+.......+.................+.+............+..+......+...+....+...+..+.+.....+.....................+.+..+.+...................................+....+........+.............+.....+....+.....+...+..........+........+.+.....+...+.............+........+....+......+.....+.......+..+............+.........+.+......+...+...............+......+...........+............+.......+...........+.......+...............+......+.................+...+.+...+..+...+.+..........................+.+.........+......+............+..+....+..+....+........+.......+........+...+...+.+...+...+..+...............+...+..........+..+.......+.........+.....+.........+................+......+...+......+.....+.......+...+..............+.+.....+.+...+...........+.+...+...+...+............+..+.......+...........+.......+...+...+...........+.....................+...+....+...........+............+...+......+..........+........+.+.....+....+.....+.+..+..........+..............+...+......+.+...+...........+.+......+...++++++ ----- Notice ------ Private-Key and Public-Certificate-Request files created. Your files are: * req: D:/EasyRSA-3.1.7/pki/reqs/p2cserver.com.req * key: D:/EasyRSA-3.1.7/pki/private/p2cserver.com.key You are about to sign the following certificate: Request subject, to be signed as a server certificate for '825' days: subject= commonName = p2cserver.com Type the word 'yes' to continue, or any other input to abort. Confirm request details: yes //输入“yes”以继续 Using configuration from D:/EasyRSA-3.1.7/pki/openssl-easyrsa.cnf Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows commonName :ASN.1 12:'p2cserver.com' Certificate is to be certified until Sep 22 09:56:54 2026 GMT (825 days) Write out database with 1 new entries Database updated Notice ------ Certificate created at: * D:/EasyRSA-3.1.7/pki/issued/p2cserver.com.crt Notice ------ Inline file created: * D:/EasyRSA-3.1.7/pki/inline/p2cserver.com.inline EasyRSA Shell # 查看服务端证书及其私钥。 生成的服务端证书默认存放在“D:\EasyRSA-3.1.7\pki\issued”目录下。 本示例中生成的证书为“p2cserver.com.crt”。 生成的服务端私钥默认存放在“D:\EasyRSA-3.1.7\pki\private”目录下。 本示例中生成的私钥为“p2cserver.com.key”。 执行“ ./easyrsa build-client-full p2cclient.com nopass”命令,生成客户端证书及其私钥。 此命令中,客户端证书的命名(如“p2cclient.com”)应与服务端证书的命名(如“p2cserver.com”)不一致。 系统显示如下类似信息: Using Easy-RSA 'vars' configuration: * D:/EasyRSA-3.1.7/pki/vars Using SSL: * openssl OpenSSL 3.1.2 1 Aug 2023 (Library: OpenSSL 3.1.2 1 Aug 2023) .......+++++++++++++++++++++++++++++++++++++++*...+...+...+.....+...+....+......+......+........+.+.....+............+++++++++++++++++++++++++++++++++++++++*.+.....+.+.....+.........+.......+..+...+.......+...+..+......+.+......+........+....+...+...+..+.......+......+.....+..........+...........+....+......+.....+.........+......+.+..+...+..........+........+......+....+......+...........+.......+.....+.............+..+.+...........+..........+...+..+.........+......+.+........+.........+.+...............+..+..........+...+............+...+.....+.+...........+....+.....+.........+....+.......................+....+...+..+....+..+.......+...+............+.....+............+.+........+.......+.....+....+.........+..+............+..........+..+.............+...+...+..++++++ ..+.....+.......+.....+.........+....+++++++++++++++++++++++++++++++++++++++*.....+......+..+++++++++++++++++++++++++++++++++++++++*.......+.+.....+....+.........+...+.....+.........+...+...............+...+....+.....+.+...+......+......+...+.........+..+...+...+....+.........+..+...+...................+......+.....+.+...+...+.........+.....+..................+...+...+......+.+..+......+.+......+.....+...+..........+..+............+.......+.........+.....+......+.+..+............+................+..+...+....+......+.....+...+....+..+......+.........+.........++++++ ----- Notice ------ Private-Key and Public-Certificate-Request files created. Your files are: * req: D:/EasyRSA-3.1.7/pki/reqs/p2cclient.com.req * key: D:/EasyRSA-3.1.7/pki/private/p2cclient.com.key You are about to sign the following certificate: Request subject, to be signed as a client certificate for '825' days: subject= commonName = p2cclient.com Type the word 'yes' to continue, or any other input to abort. Confirm request details: yes //输入“yes”以继续 Using configuration from D:/EasyRSA-3.1.7/pki/openssl-easyrsa.cnf Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows commonName :ASN.1 12:'p2cclient.com' Certificate is to be certified until Sep 22 09:58:26 2026 GMT (825 days) Write out database with 1 new entries Database updated Notice ------ Certificate created at: * D:/EasyRSA-3.1.7/pki/issued/p2cclient.com.crt Notice ------ Inline file created: * D:/EasyRSA-3.1.7/pki/inline/p2cclient.com.inline EasyRSA Shell # 查看客户端证书及其私钥。 生成的客户端证书默认存放在“D:\EasyRSA-3.1.7\pki\issued”目录下。 本示例中生成的证书为“p2cclient.com.crt”。 生成的客户端私钥默认存放在“D:\EasyRSA-3.1.7\pki\private”目录下。 本示例中生成的私钥为“p2cclient.com.key”。
  • 创建访问策略操作步骤 在“终端入云VPN网关”页面,单击目标VPN网关操作列的“查看服务端”。 在“访问策略 ”页签中,单击“创建策略”。 根据界面提示配置参数,然后单击“确定”。 本示例仅对关键参数进行说明。 表4 创建策略参数说明 参数 说明 参数取值 名称 只能由中文、英文字母、数字、下划线、中划线组成。 Policy_01 目的网段 输入网段,多个以半角逗号隔开,例如:192.168.1.0/24,192.168.2.0/24。 192.168.1.0/24 用户组 选择用户组。 Testgroup_01
  • 操作步骤 在“终端入云VPN网关”页面,单击目标VPN网关操作列的“配置服务端”。 根据界面提示配置参数,然后单击“确定”。 本示例仅对关键参数进行说明,全量参数请参见配置服务端。 表1 服务端参数说明 区域 参数 说明 取值样例 基本信息 本端网段 客户端需要访问的目标网段。 支持“选择子网”和“输入网段”两种方式。 192.168.1.0/24 客户端网段 分配给客户端虚拟网卡地址的网段。 172.16.0.0/16 认证信息 服务端证书 选择服务端证书。 cert-scsxxxxxxxxxxxxx 客户端CA证书 需要先单击“上传CA证书”进行上传操作。 如果存在多级CA证书,需要将证书链的所有CA证书都上传。 ca-cert-xxxx 高级配置 协议 保持默认。 UDP 端口 保持默认。 443 加密算法 保持默认 AES-128-GCM
  • 操作步骤 下载Easy-RSA。 下载后请解压缩软件压缩包。 打开Easy-RSA shell。 打开命令行窗口,切换到软件所在目录,执行“.\EasyRSA-Start.bat”命令。 图1 打开Easy-RSA shell 初始化PKI环境。 执行“./easyrsa init-pki”命令,生成PKI,自动创建名为“pki”的文件夹。 (可选)配置变量参数。 默认按配置模板“vars.example”中描述的参数值进行配置。如需自定义参数值,先将“vars.example”复制到“pki”文件夹下并重命名为“vars”,再按需设置参数值。 图2 配置变量参数 生成CA证书。 执行“ ./easyrsa build-ca nopass”命令生成CA证书,存放在“pki”文件夹中。 生成服务端证书和私钥。 执行 “./easyrsa build-server-full filename_base nopass”命令生成服务端证书和私钥。 此命令中,“filename_base”为证书的CN,请根据实际填写。 “filename_base”必须是域名格式,否则无法正常托管到云证书管理服务,示例如下: ./easyrsa build-server-full p2cvpn.server nopass 生成客户端证书和私钥。 执行“ ./easyrsa build-client-full filename_base nopass”命令生成客户端证书和私钥。 查看服务端、客户端证书和私钥。 生成的服务端和客户端证书默认存放在“issued”文件夹中,生成的服务端和客户端的私钥默认存放在“private”文件夹中。 图3 查看证书和私钥
  • 安装客户端软件并导入配置文件 本示例为您介绍如何配置Windows客户端,不同类型VPN客户端软件及版本可能存在差异,配置时请以实际为准。 操作系统:Windows 10 客户端软件:OpenVPN Connect 3.3.4(2600) 更多客户端配置案例,请参见配置客户端。 在OpenVPN官方网站下载OpenVPN Connect,根据界面提示进行安装。 启动OpenVPN Connect客户端,在“FILE”页签下单击“BROWSE”,上传客户端配置文件。 图1 上传配置文件 单击“CONNECT”尝试建立VPN连接,若出现类似下图所示界面,代表连接成功。 图2 连接成功