Hide36
 
 
Computer
Anything Writes to a note.
OpenVPN  (Open Virtual Private Network) バーチャル・プライベート・ネットワーク                    《英三郎》
     
 


  ダウンロードとインストール  
 
ダウンロード  
 
インストール  

  サーバーの設定  
 
証明書とキーの作成準備  
 
vars.bat.sample の編集  
 
vars.batとopenssl.cnf の作成  
 
ca認証証明書の作成  
 
サーバー用の証明書  
 
DHパラメータの作成  
 
クライアント用証明書の作成  
 
複数のClient(接続先)の設定  
 
サーバー用コンフィグの編集  

  ▼ サーバーの起動接続  
 
ネットワークアダプターの設定  
 
OpenVPN GUI の起動と接続  
 
アダプターとルータの設定  
 
ファイアウォールの設定  
 
接続の確認方法  
 
 
  クライアントの構築  
 
クライアントコンフィグの作成  
 
MyTapとファイアウォールの設定  
 
OpenVPN GUI の起動とサーバーに接続  

 
コマンドプロンプトの使用方法  
 
ファイアウォールの設定  

       
       

  ■ OpenVPN Windows7 (x64) に構築 2 《サーバーの設定》

《設定前に》
 
ダウンロードとインストールがまだの方は、
■ OpenVPN Windows7 (x64) に構築 1 《ダウンロードとインストール》』へ
 
     

 
  ▼ SSL/TLS サーバ証明書とキーの作成準備 『vars.bat.sample』の書き換え  

 
 
各内容が『build-ca』や『build-key-server』『build-key-server client01』 を作成するときに反映される方法として先に『vars.bat.sample』を編集します。  
 
管理者のアクセス許可、書込み許可が必要になる場合があります。  
 
『C:\Program Files\OpenVPN\easy-rsa』フォルダ内の
『vars.bat.sample』を控えを取ってからエディタで編集します。
 
   

※エディタが書き込み禁止(読み取り専用)の場合は『プロパティ』→『セキュリティ』から『書き込み』ができるようにしてください。

 
 
 
    ※赤文字は入力。 適宜、自分用に変更してください。  
    ※青、緑文字は注釈です。 緑 《Enter》はEnterキーです。  
    ※参考のため原文はなるべく残しておきました。 文字コードはUTF-8  
       
   

@echo off
rem Edit this variable to point to
rem the openssl.cnf file included
rem with easy-rsa.

set HOME=%ProgramFiles%\OpenVPN\easy-rsa
rem このディレクトリをHomeディレクトリとします。
rem 32bit版をインストールした場合のHomeディレクトリです。
rem set HOME=%ProgramFiles (x86)%\OpenVPN\easy-rsa
set KEY_CONFIG=openssl-1.0.0.cnf
rem OpenVPN SSLで使用するファイル名、openssl.cnfのときはここを変える。
rem set KEY_CONFIG=openssl.cnf

rem Edit this variable to point to
rem your soon-to-be-created key
rem directory.
rem
rem WARNING: clean-all will do
rem a rm -rf on this directory
rem so make sure you define
rem it correctly!
set KEY_DIR=keys
rem カレント内に作成するキーディレクトリ名を『keys』とする

rem Increase this to 2048 if you
rem are paranoid. This will slow
rem down TLS negotiation performance
rem as well as the one-time DH parms
rem generation process.
set KEY_SIZE=1024
rem Keyの暗号化サイズ。強化する場合は1024の倍数で増やす。
rem set KEY_SIZE=4096

rem These are the default values for fields
rem which will be placed in the certificate.
rem Change these to reflect your site.
rem Don't leave any of these parms blank.

rem set KEY_COUNTRY=US        (国名)
set KEY_COUNTRY=JP
rem set KEY_PROVINCE=CA       (都道府県名)
set KEY_PROVINCE=Tokyo
rem set KEY_CITY=SanFrancisco     (区市町村)
set KEY_CITY=Chiyoda
rem set KEY_ORG=OpenVPN       (組織名)
set KEY_ORG=Chiyoda Cop
rem set KEY_EMAIL=mail@host.domain (管理者のメールアドレス)
set KEY_EMAIL=myadmin@chiyoxxxx.co.jp
rem これより以下は今回は使用しませんからコメントアウトしても構いません。
set KEY_CN=changeme
set KEY_NAME=changeme
set KEY_OU=changeme
set PKCS11_MODULE_PATH=changeme
set PKCS11_PIN=1234

 
    ※保存して閉じる。 (文字コード UTF-8)  
     

  ■ OpenVPN 《サーバ証明書とキーの作成

  ▼ 『vars.bat』と『openssl.cnf』の作成  
 
 
       
 
『コマンドプロンプト』の起動。  
     『スタート』→『すべてのプログラム』→『アクセサリ』から『コマンド プロンプト』を選択します。  
 
HOMEディレクトリを『cd 』スペースで『C:\Program Files\OpenVPN\easy-rsa』に移動します。  
 
『init-config』と入力してbatを実行します。  
 
『vars.bat.sample』が『vars.bat』にリネームコピーされます。  
 
『openssl-1.0.0.cnf』も『openssl.cnf』リネームコピーします。  
    ※『コマンド プロンプト』しばらく使うので右クリックして『ショートカット』をデスクトップに作成しておいたほうが便利です。  
       
   

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\user01>cd C:\Program Files\OpenVPN\easy-rsa

C:\Program Files (x86)\OpenVPN\easy-rsa>init-config
1 個のファイルをコピーしました
※『vars.bat.sample』から『vars.bat』を作成。

 
    ※『C:\Program Files\OpenVPN\easy-rsa』内に『vars.bat』が作成されます。  
    32bit版の場合『cd C:\Program Files (x86)\OpenVPN\easy-rsa』になります。  
     
 
 
  ▼ OpenVPN 専用 『ca 認証証明書』の作成  
 
 
 
『vars』を実行します。  
 
『clean-all』全てクリーンにします。 (『keys』のca等が有った場合削除します)  
    ※最初は『keys』にCleanにするファイルがないので『指定されたパスもファイルも見つかりません。』が表示される。
※『keys』フォルダが作成され『index.txt』と『serial』ファイルがフォルダ内に作成されます。
 
 
『build-ca』を実行して『ca認証証明書』を作成します。  
    『WARNING: can't open config file: /etc/ssl/openssl.cnf』
が表示されたら 『c:/etc/ssl』フォルダを作成し、その中に『openssl.cnf』をコピーします。
 
 
Common Name…は任意の名称です。(例:『MY_VPN』)  
       
   

C:\Program Files (x86)\OpenVPN\easy-rsa>vars

C:\Program Files (x86)\OpenVPN\easy-rsa>clean-all
指定されたファイルが見つかりません。
1 個のファイルをコピーしました。
1 個のファイルをコピーしました。

C:\Program Files (x86)\OpenVPN\easy-rsa>build-ca
Loading 'screen' into random state - done
Generating a 1024 bit RSA private key
.........................................++++++
..++++++
unable to write 'random state'
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) [JP]:《Enter》
State or Province Name (full name) [Tokyo]:《Enter》
Locality Name (eg, city) [Chiyoda]:《Enter》
Organization Name (eg, company) [Chiyoda Cop]:《Enter》
Organizational Unit Name (eg, section) [changeme]: 空白《Enter》 (部署名を入力しても可)
Common Name (eg, your name or your server's hostname) [changeme]:MY_VPN 《Enter》
Name [changeme]: 空白《Enter》
Email Address [myadmin@chiyoxxxx.co.jp]: 《Enter》

 
    ※『C:\Program Files\OpenVPN\easy-rsa』に『keys』フォルダと『ca.crt』『ca.key』ファイルが作成されます。  
       
 
 
 
『build-ca』を実行時に『WARNING』が表示されたとき。  
   

C:\Program Files (x86)\OpenVPN\easy-rsa>build-ca
WARNING: can't open config file: /etc/ssl/openssl.cnf
Loading 'screen' into random state - done
Generating a 1024 bit RSA private key


 
 
『c:\etc\ssl』を作成して『openssl.cnf』をコピーします。  
   

C:\Program Files (x86)\OpenVPN\easy-rsa>mkdir c:\etc\ssl

C:\Program Files (x86)\OpenVPN\easy-rsa>copy openssl-1.0.0.cnf c:\etc\ssl\openssl-1.0.0.cnf
または
C:\Program Files (x86)\OpenVPN\easy-rsa>copy openssl-1.0.0.cnf c:\etc\ssl\openssl.cnf

 
     
 
 
  ▼ サーバー用 証明書の作成  
 
 
 
『build-key-server』 『server』サーバー用の証明書を作成します。  
 

Common Name…は任意のサーバー名です。(例:『MYVPNSERVER』)

 
    ※ここではパスワードは指定しません。 (設定しても可)  
       
   

C:\Program Files (x86)\OpenVPN\easy-rsa>build-key-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) [JP]:《Enter》
State or Province Name (full name) [Tokyo]:《Enter》
Locality Name (eg, city) [Chiyoda]:《Enter》
Organization Name (eg, company) [Chiyoda Cop]:《Enter》
Organizational Unit Name (eg, section) [changeme]: 空白《Enter》 (部署名を入力しても可)
Common Name (eg, your name or your server's hostname) [changeme]:MYVPN_SERVER 《Enter》
Name [changeme]:空白《Enter》
Email Address [myadmin@chiyoxxxx.co.jp]: 《Enter》

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:空白《Enter》 ※パスワードはGUIから変更できます。
An optional company name []:空白《Enter》
Using configuration from openssl-1.0.0.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:'JP'
stateOrProvinceName :PRINTABLE:'Tokyo'
localityName       :PRINTABLE:'Chiyoda'
organizationName    :PRINTABLE:'ChiyodaCop'
organizationalUnitName:PRINTABLE:'changeme'
commonName      :PRINTABLE:'MYVPNSERVER'
name           :PRINTABLE:'changeme'
emailAddress       :IA5STRING:'myadmin@xxxxxxxx.co.jp'
Certificate is to be certified until Nov 12 04:49:39 2022 GMT (3650 days)
Sign the certificate? [y/n]:y 《Enter》

1 out of 1 certificate requests certified, commit? [y/n]y 《Enter》
Write out database with 1 new entries
Data Base Updated

 
    ※『C:\Program Files\OpenVPN\easy-rsa\keys』フォルダに
『server.crt』『server.csr』『server.key』ファイルが作成されます。
 
     
 
 
  ▼ DH パラメータの作成  
 
 
 
サーバーとクライアントとの暗号化キーを作成します。  
 
『Generating a 1024 bit RSA private key』で指定したバイト数によってパラメータが決まります。  
    『1024』の倍数『2048』『3068』…大きくなれば処理時間も増えます。  
       
   

C:\Program Files (x86)\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
.....................................+.....................................................+.....................................................+..............
.............................+...........................+.....+........+....+..........................+...............................+.............+
.....................................+...........................+...........................................................................+.................
    ・


.................................+......................+............................+..+...............+...................................................+
...........+..................+...........................++*++*++*
unable to write 'random state'

 
    ※『C:\Program Files\OpenVPN\easy-rsa\keys』フォルダ内に 『dh1024.pem』が作成されました。  
       
       
     
 
 
  ▼ クライアント用 証明書の作成  
 
 
 
クライアント用の証明証を作成します。クライアントマシンにコピーして使用します。
複数作成する場合は名称を変えて作成します。(例:『client01』、『client02』は任意の名称)
 
       
   

C:\Program Files (x86)\OpenVPN\easy-rsa>build-key client01
Loading 'screen' into random state - done
Generating a 1024 bit RSA private key
............++++++
.........................................++++++
unable to write 'random state'
writing new private key to 'keys\client01.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) [JP]: 《Enter》
State or Province Name (full name) [Tokyo]: 《Enter》
Locality Name (eg, city) [Chiyoda]: 《Enter》
Organization Name (eg, company) [ChiyodaCop]: 《Enter》
Organizational Unit Name (eg, section) [changeme]: 《Enter》
Common Name (eg, your name or your server's hostname) [changeme]:client_01 《Enter》
Name [changeme]: 《Enter》
Email Address [myadmin@xxxxxxxx.co.jp]: 《Enter》

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:******** 《Enter》
An optional company name []: 《Enter》
Using configuration from openssl-1.0.0.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:'JP'
stateOrProvinceName :PRINTABLE:'Tokyo'
localityName :PRINTABLE:'Chiyoda'
organizationName :PRINTABLE:'ChiyodaCop'
organizationalUnitName:PRINTABLE:'changeme'
commonName :PRINTABLE:'client01'
name :PRINTABLE:'changeme'
emailAddress :IA5STRING:'myadmin@xxxxxxxx.co.jp'
Certificate is to be certified until Nov 12 06:59:18 2022 GMT (3650 days)
Sign the certificate? [y/n]:y 《Enter》

1 out of 1 certificate requests certified, commit? [y/n]y 《Enter》
Write out database with 1 new entries
Data Base Updated
unable to write 'random state'

 
    ※『C:\Program Files\OpenVPN\easy-rsa\keys』フォルダに
『client01.crt』『client01.csr』『client01.key』ファイルが作成されます。
 
 
Common Name (eg, your name or your server's hostname) [changeme]:chiyoda_01  
     
 
 
    ◎ 『複数のClient(接続先)』の作成  
 
 
 
Client(接続先)が複数の場合は『build-key client02』『build-key client03』等で繰り返し作成します。 『clientX』は任意名称です。  
 
 
       
     
       
  ■ OpenVPN 《サーバーConfig server.ovpn の作成》 (ルーティング方式)  
       
  ▼ Config 『server.ovpn』の編集(ルーティング接続)  

     
    『C:\Program Files\OpenVPN\sample-config』内の『server.ovpn』を『C:\Program Files\OpenVPN\config』にコピーして編集します。  
    ネットワーク ブリッジを使用する場合を緑色でコメントしました。  
       
     

     
    『server.ovpn』ファイル
※最小限、太文字のところを確認し、必要に応じて書き換えます。
 
   

#################################################
# Sample OpenVPN 2.0 config file for #
# multi-client server. #
# #
# This file is for the server side #
# of a many-clients <-> one-server #
# OpenVPN configuration. #
# #
# OpenVPN also supports #
# single-machine <-> single-machine #
# configurations (See the Examples page #
# on the web site for more info). #
# #
# This config should work on Windows #
# or Linux/BSD systems. Remember on #
# Windows to quote pathnames and use #
# double backslashes, e.g.: #
# "C:\\Program Files\\OpenVPN\\config\\foo.key" #
# #
# Comments are preceded with '#' or ';' #
#################################################

# Which local IP address should OpenVPN
# listen on? (optional)
;local a.b.c.d

# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one. You will need to
# open up this port on your firewall.
port 1194
# 使用ポート番号ポート1194(任意のポートに変更可)

# TCP or UDP server?
;proto tcp
proto udp

# 使用ポートは『UDP』を使用(UDP:1194番を使用となります)
# ※TCP:1194番を使用の場合は『;proto tcp』行頭の『;』を削除して『proto udp』の行頭に『;』を追加します。

# "dev tun" will create a routed IP tunnel,
# "dev tap" will create an ethernet tunnel.
# Use "dev tap0" if you are ethernet bridging
# and have precreated a tap0 virtual interface
# and bridged it with your ethernet interface.
# If you want to control access policies
# over the VPN, you must create firewall
# rules for the the TUN/TAP interface.
# On non-Windows systems, you can give
# an explicit unit number, such as tun0.
# On Windows, use "dev-node" for this.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun

# 仮想デバイスを使用(ルーティング)。
# ブリッジ方式の場合は『;dev tap』の行頭の『;』を外し『dev tun』の行頭に『;』を付ける。

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel if you
# have more than one. On XP SP2 or higher,
# you may need to selectively disable the
# Windows firewall for the TAP adapter.
# Non-Windows systems usually don't need this.
;dev-node MyTap
dev-node MyTap
# ネットワークアダプタの名称を『MyTap』とする(任意名称)。
# OpenVPNで作成されたネットワークアダプタの名称を変更。
# 『ローカル エリア接続2(TAP-Win32Adapte V9r)』を『MyTap』に名前を変更。

# 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
# 上記の設定で使用の場合は 『server.ovpn』と同じフォルダに入れます。
# (行頭に『;』を付加し原文を残しました)

ca "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\ca.crt"
# 作成した認証証明証『ca.crt』をフルパスで記載。

cert "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\server.crt"
# 作成した認証証明証『server.crt』をフルパスで記載。
key "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\server.key"
# 同時に作成した『server.key』もフルパスで記載。

# Diffie hellman parameters.
# Generate your own with:
# openssl dhparam -out dh1024.pem 1024
# Substitute 2048 for 1024 if you are using
# 2048 bit keys.
;dh dh1024.pem
# 上記の設定で使用の場合は 『server.ovpn』と同じフォルダに入れます。
# (行頭に『;』を付加し原文を残しました)
dh "C:\\Program Files\\OpenVPN\\easy-rsa\\keys\\dh1024.pem"
# DHパラメータ『dh1024.pem』もフルパスで記載。
# 『set KEY_SIZE=2048』で設定した場合は『dh2048.pem』です。

# Configure server mode and supply a VPN subnet
# for OpenVPN to draw client addresses from.
# The server will take 10.8.0.1 for itself,
# the rest will be made available to clients.
# Each client will be able to reach the server
# on 10.8.0.1. Comment this line out if you are
# ethernet bridging. See the man page for more info.
server 10.8.0.0 255.255.255.0
# 一般的には使用していないと思いますが、重複している場合は書き換えます。
# ブリッジ方式の場合は、行頭に『;』を付加し、server-bridgeでアドレスを指定。

# Maintain a record of client <-> virtual IP address
# associations in this file. If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.
ifconfig-pool-persist ipp.txt
#再接続を繰り返し要求のとき使用します。

# Configure server mode for ethernet bridging.
# You must first use your OS's bridging capability
# to bridge the TAP interface with the ethernet
# NIC interface. Then you must manually set the
# IP/netmask on the bridge interface, here we
# assume 10.8.0.4/255.255.255.0. Finally we
# must set aside an IP range in this subnet
# (start=10.8.0.50 end=10.8.0.100) to allocate
# to connecting clients. Leave this line commented
# out unless you are ethernet bridging.
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
# ブリッジ方式の場合は、行頭の『;』を外し書き換え、
# 現在使用のアドレスと範囲を指定。
# 例:『server-bridge 192.168.0.10 255.255.255.0 192.168.0.100 192.168.0.110』

# Configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses. You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
;server-bridge

# 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 192.168.10.0 255.255.255.0"
# ブリッジ使用のときは行頭の『;』を外しルートを指定します。
# 例:『push "route 192.168.0.0 255.255.255.0"』
192.168.10.0/24のセグメントを変えてみました。
;push "route 192.168.20.0 255.255.255.0"

# To assign specific IP addresses to specific
# clients or if a connecting client has a private
# subnet behind it that should also have VPN access,
# use the subdirectory "ccd" for client-specific
# configuration files (see man page for more info).

# EXAMPLE: Suppose the client
# having the certificate common name "Thelonious"
# also has a small subnet behind his connecting
# machine, such as 192.168.40.128/255.255.255.248.
# First, uncomment out these lines:
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248

# Then create a file ccd/Thelonious with this line:
# iroute 192.168.40.128 255.255.255.248
# This will allow Thelonious' private subnet to
# access the VPN. This example will only work
# if you are routing, not bridging, i.e. you are
# using "dev tun" and "server" directives.

# EXAMPLE: Suppose you want to give
# Thelonious a fixed VPN IP address of 10.9.0.1.
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252

# Then add this line to ccd/Thelonious:
# ifconfig-push 10.9.0.1 10.9.0.2

# Suppose that you want to enable different
# firewall access policies for different groups
# of clients. There are two methods:
# (1) Run multiple OpenVPN daemons, one for each
# group, and firewall the TUN/TAP interface
# for each group/daemon appropriately.
# (2) (Advanced) Create a script to dynamically
# modify the firewall in response to access
# from different clients. See man
# page for more info on learn-address script.
;learn-address ./script

# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the VPN, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the VPN
# (The OpenVPN server machine may need to NAT
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
;push "redirect-gateway def1 bypass-dhcp"

# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses. CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# DNS servers provided by opendns.com.
;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option WINS 208.67.220.220"

# Uncomment this directive to allow different
# clients to be able to "see" each other.
# By default, clients will only see the server.
# To force clients to only see the server, you
# will also need to appropriately firewall the
# server's TUN/TAP interface.
;client-to-client
# クライアントとクライアントを接続するとき

# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names. This is recommended
# only for testing purposes. For production use,
# each client should have its own certificate/key
# pair.
#
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
# UNCOMMENT THIS LINE OUT.
;duplicate-cn

# The keepalive directive causes ping-like
# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
keepalive 10 120
# キープアライブの設定時間

# For extra security beyond that provided
# by SSL/TLS, create an "HMAC firewall"
# to help block DoS attacks and UDP port flooding.
#
# Generate with:
# openvpn --genkey --secret ta.key
#
# The server and each client must have
# a copy of this key.
# The second parameter should be '0'
# on the server and '1' on the clients.
;tls-auth ta.key 0 # This file is secret
# TLS認証を使用するとき。

# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
;cipher BF-CBC # Blowfish (default)
;cipher AES-128-CBC # AES
;cipher DES-EDE3-CBC # Triple-DES

# Enable compression on the VPN link.
# If you enable it here, you must also
# enable it in the client config file.
comp-lzo
# lzo圧縮をする。圧縮しないときは行頭に『;』を付加
# クライアントの設定も合わせる。

# The maximum number of concurrently connected
# clients we want to allow.
;max-clients 100
# クライアントの最大接続数を指定。

# It's a good idea to reduce the OpenVPN
# daemon's privileges after initialization.
#
# You can uncomment this out on
# non-Windows systems.
;user nobody
;group nobody

# The persist options will try to avoid
# accessing certain resources on restart
# that may no longer be accessible because
# of the privilege downgrade.
persist-key
persist-tun

# 切断したとき等の再接続に関する処理

# Output a short status file showing
# current connections, truncated
# and rewritten every minute.
status openvpn-status.log
# OpenVPNのステータスログの作成

# By default, log messages will go to the syslog (or
# on Windows, if running as a service, they will go to
# the "\Program Files\OpenVPN\log" directory).
# Use log or log-append to override this default.
# "log" will truncate the log file on OpenVPN startup,
# while "log-append" will append to it. Use one
# or the other (but not both).
;log openvpn.log
;log-append openvpn.log

# ログを追加継続するときの設定

# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 3
# ログレベル3の設定です。

# Silence repeating messages. At most 20
# sequential messages of the same message
# category will be output to the log.
;mute 20

 
       
       
     

  ■ 『 コマンドプロンプト』の簡単な使用説明  

    ・ファイル、フォルダ、ディレクトリ、パスの表示。
表示させたいファイルをドラッグアンドドロップしてください。
コマンドプロンプト(>)以後にディレクトリ、ファイル名までのパスが表示されます。
階層が深い場合の入力が便利です。
ただし『”xxxxx”』ダブルクオーテーションマークが付加されますから必要に応じて削除してください。
 
       
    ・文章のコピーの仕方  
      右クリックで『範囲指定』を選択し、コピーしたい文章の範囲をドラッグして反転させ『Enter』キーを押します。

※右クリックで『コピー』を選択または『Ctrl』+『C』が使えない場合があります。
コマンドプロンプト(>)でペーストしたい位置で右クリックして『貼り付け』します。
※ (『Ctrl』+『V』は使用できません)
 
       
    ・ファンクションキーの使用方法  
    [F3]で最後に入力した文字を再入力(ペースト)します。
[F7]で入力した一覧が表示されます。 [Esc]で戻ります。
[F2]でコピー範囲を指定できます。 [BackSpace]で戻ります。
[F8]で今までに入力した文字が順次表示されます。
[F9]コマンド番号(プロンプトの表示行順番)を入力することで、
その行の入力した文字が表示されます。 [Esc]で戻ります。
 
    [Delete][BackSpace]で削除。
 
       
    >exit で『コマンドプロンプト』は終了します。  

       
    これでサーバー側の基本設定は終わります。  
    次は、■ OpenVPN Windows7 (x64) に構築 3 《ネットワークアダプターの設定》 へ続きます。  
       
       
       

    Hide36 Conputer Note  
    OpenVPN での Windows7 (x64) Virtual Private Networkの構築  
    OpenVPN Windows7 (x64) に構築 1 《ダウンロードとインストール》  
    OpenVPN Windows7 (x64) に構築 2 《サーバーの設定》  
    OpenVPN Windows7 (x64) に構築 3 《ネットワークアダプターの設定》  
    OpenVPN Windows7 (x64) に構築 4 《クライアントの設定》