C:\Program Files\OpenVPN\easy-rsa>init-config.bat
C:\Program Files\OpenVPN\easy-rsa>copy vars.bat.sample vars.bat
: 1.
C:\Program Files\OpenVPN\easy-rsa>copy openssl.cnf.sample openssl.cnf
: 1.
@echo off
set HOME=%ProgramFiles%\OpenVPN\easy-rsa
set KEY_CONFIG=openssl.cnf
set KEY_DIR=keys
set KEY_SIZE=2048
set KEY_COUNTRY=RU
set KEY_PROVINCE=MSK
set KEY_CITY=Moskow
set KEY_ORG=Kremlin
set KEY_EMAIL=none@net.com
vars.bat
clean-all.bat
build-ca.bat
build-dh.bat
build-key-server.bat homepc
C:\Program Files\OpenVPN\easy-rsa>vars
C:\Program Files\OpenVPN\easy-rsa>clean-all.bat
: 1.
: 1.
C:\Program Files\OpenVPN\easy-rsa>build-ca.bat
Loading 'screen' into random state - done
Generating a 2048 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) [RU]:
State or Province Name (full name) [MSK]:
Locality Name (eg, city) [Moskow]:
Organization Name (eg, company) [Kremlin]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:server
Email Address [none@net.com]:
C:\Program Files\OpenVPN\easy-rsa>build-dh.bat
Loading 'screen' into random state - done
Generating DH parameters, 2048 bit long safe prime, generator 2
This is going to take a long time
...........+........++*
C:\Program Files\OpenVPN\easy-rsa>build-key-server.bat homepc
Loading 'screen' into random state - done
Generating a 2048 bit RSA private key
...........................................................+++
.......................+++
writing new private key to 'keys\homepc.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) [RU]:
State or Province Name (full name) [MSK]:
Locality Name (eg, city) [Moskow]:
Organization Name (eg, company) [Kremlin]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:homepc
Email Address [none@net.com]:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
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:'RU'
stateOrProvinceName :PRINTABLE:'MSK'
localityName :PRINTABLE:'Moskow'
organizationName :PRINTABLE:'Kremlin'
commonName :PRINTABLE:'homepc'
emailAddress :IA5STRING:'none@net.com'
Certificate is to be certified until Aug 11 12:51:16 2018 GMT (3650 days)
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
C:\Program Files\OpenVPN\easy-rsa>
############################
# OpenVPN
mode server
# TLS
tls-server
# , udp tcp-server
proto tcp-server
# ,TUN - , TAP -
dev tap
#
port 12345
#
ca ca.crt
#
cert homepc.crt
#
key homepc.key
# -
dh dh2048.pem
#
ifconfig 10.0.1.1 255.255.255.0
# , 3
verb 3
# , 256
keysize 256
# , blowfish
cipher BF-CBC
#
comp-lzo
C:\Program Files\OpenVPN\easy-rsa>build-key-pkcs12.bat officepc
Loading 'screen' into random state - done
Generating a 2048 bit RSA private key
................................................................................
.......+++
...+++
writing new private key to 'keys\officepc.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) [RU]:
State or Province Name (full name) [MSK]:
Locality Name (eg, city) [Moskow]:
Organization Name (eg, company) [Kremlin]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:officepc
Email Address [none@net.com]:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
Using configuration from openssl.cnf
Loading 'screen' into random state - done
DEBUG[load_index]: unique_subject = "yes"
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName :PRINTABLE:'RU'
stateOrProvinceName :PRINTABLE:'MSK'
localityName :PRINTABLE:'Moskow'
organizationName :PRINTABLE:'Kremlin'
commonName :PRINTABLE:'officepc'
emailAddress :IA5STRING:'none@net.com'
Certificate is to be certified until Aug 11 13:17:22 2018 GMT (3650 days)
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
Loading 'screen' into random state - done
Enter Export Password:
Verifying - Enter Export Password:
C:\Program Files\OpenVPN\easy-rsa>
#
dev tap
# TLS
tls-client
#
remote $HOMEIP 12345
#
proto tcp-client
#
ifconfig 10.0.1.2 255.255.255.0
#
comp-lzo
#
verb 3
#
pkcs12 cert.p12
#
comp-lzo
#
keysize 256
#
cipher BF-CBC
Source: https://habr.com/ru/post/36845/
All Articles