RouterOS配置OpenVPN Server方法
一、OpenVPN证书制作
1、 1.1 下载Open VPN 并安装 安装Open VPN
Open VPN 安装完成。
安装完成后生成一个新网卡。
2、 制作证书
2.1 修改D:\\OpenVPN\\easy-rsa\\vars.bat.sample的以下部分 set HOME=%ProgramFiles%\\OpenVPN\\easy-rsa set KEY_COUNTRY=US set KEY_PROVINCE=CA
set KEY_CITY=SanFrancisco set KEY_ORG=FortFunston
set KEY_EMAIL=mail@host.domain
请根据自身情况修改改为: set KEY_COUNTRY=CN
set KEY_PROVINCE=Home911 set KEY_CITY=ChangChun set KEY_ORG=QCC
set KEY_EMAIL=mynetmail@foxmail.com
(注:修改vars.bat.sample文件用写字板)
2.2 Open VPN安全模式:
Open VPN 有两种安全模式。
一种基于使用 RSA 证书和密钥的 SSL/TLS。 一种使用预先分享的静态密钥。 本文采用SSL/TLS 模式。
TLS模式的优点是安全,而且便于管理用户。
默认情况下证书和用户是一对一的,多个用户使用同一证书会被踢出。 2.3 制作证书:
开始-->运行...-->键入cmd,回车,进入命令提示符-->进入D:\\OpenVPN\\easy-rsa目录 D:\\OpenVPN\\easy-rsa> 执行如下命令: init-config
D:\\OpenVPN\\easy-rsa>init-config <回车>
D:\\OpenVPN\\easy-rsa>copy vars.bat.sample vars.bat 已复制 1 个文件。
D:\\OpenVPN\\easy-rsa>copy openssl.cnf.sample openssl.cnf 已复制 1 个文件。 vars
D:\\OpenVPN\\easy-rsa>vars <回车> clean-all
D:\\OpenVPN\\easy-rsa>clean-all <回车> 系统找不到指定的文件。 已复制 1 个文件。 已复制 1 个文件。 Vars
D:\\OpenVPN\\easy-rsa>vars <回车> build-ca
D:\\OpenVPN\\easy-rsa>build-ca <回车> #生成根证书 Loading 'screen' into random state - done Generating a 1024 bit RSA private key ............++++++ ...++++++
writing new private key to 'keys\\ca.key' -----
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. -----
Country Name (2 letter code) [CN]: <回车>
State or Province Name (full name) [Office911]: <回车> Locality Name (eg, city) [ChangChun]: <回车> Organization Name (eg, company) [QCQ]: <回车>
Organizational Unit Name (eg, section) []:QCLZ <回车>
Common Name (eg, your name or your server's hostname) []:OVPN_IN One <回车> Email Address [mynetmail@foxmail.com]: Vars
D:\\OpenVPN\\easy-rsa>vars <回车> build-dh
D:\\OpenVPN\\easy-rsa>build-dh <回车> #这个有点慢,估计要半分钟 Loading 'screen' into random state - done
Generating DH parameters, 1024 bit long safe prime, generator 2 This is going to take a long time
...............+...................................+........+................... .......+...+......................+.........+................................... ...................................................+............................ ......................+......................................................... .......+......................++*++*++* Vars
D:\\OpenVPN\\easy-rsa>vars <回车> build-key-server server
D:\\OpenVPN\\easy-rsa>build-key-server server <回车> #生成服务器端的密钥 Server 为服务器端文件名
Loading 'screen' into random state - done Generating a 1024 bit RSA private key .......................++++++
..................................................................++++++ writing new private key to 'keys\\server.key' -----
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. -----
Country Name (2 letter code) [CN]:
State or Province Name (full name) [Office911]: Locality Name (eg, city) [ChangChun]: Organization Name (eg, company) [QCQ]:
Organizational Unit Name (eg, section) []:QCLZ
Common Name (eg, your name or your server's hostname) []:OVPN_IN One Email Address [mynetmail@foxmail.com]:
Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []:1124 An optional company name []:
Using configuration from openssl.cnf
Loading 'screen' into random state - done Check that the request matches the signature Signature ok
The Subject's Distinguished Name is as follows countryName :PRINTABLE:'CN'
stateOrProvinceName :PRINTABLE:'Office911' localityName :PRINTABLE:'ChangChun' organizationName :PRINTABLE:'QCQ' organizationalUnitName:PRINTABLE:'QCLZ'
commonName :T61STRING:'OVPN_IN One'
emailAddress :IA5STRING:'mynetmail@foxmail.com'
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库RouterOS配置OpenVPN Server方法在线全文阅读。
相关推荐: