JDP 發表於 2015-11-3 10:54:35

安裝OpenVPN Server (Windows)

下載OpenVPN - https://openvpn.net/index.php/open-source/downloads.html
Server部份

[*]新增 D:\OpenVPN\config\server.ovpn
        port 1194# 連接的埠號#
        proto udp# 採用udp連線#
        dev tun
        ca ca.crt#認證檔案#
        cert server.crt#認證檔案#
        key server.key #認證檔案#
        dh dh1024.pem #採用1024位元加密,也可以改為2048#
        #網路設定#
        server 10.66.1.0 255.255.255.0
        ifconfig-pool-persist ipp.txt
        push "route 10.66.1.0 255.255.255.0"
        push "dhcp-option DNS 8.8.8.8"
        keepalive 10 120
        comp-lzo
        max-clients 10
        persist-key
        persist-tun
        status openvpn-status.log
        verb 3
        #如果要讓連上來的 client 可以互連的話,請加下列參數#
        client-to-client

[*]cd D:\OpenVPN\easy-rsa
[*]init-config
[*]編輯 vars.bat
(1)set HOME=D:\OpenVPN\easy-rsa (修改HOME為OpenVPN安裝目錄下的easy-rsa)
(2)set OPENSSL_CONF=D:\OpenVPN\easy-rsa\openssl-1.0.0.cnf(自行新增此行)
(3)修改最下方相關KEY值以節少時間
[*]vars
[*]clean-all
[*]產生ca key (重覆產生的話,Client的Key需要重新產生)
build-ca
[*]產生DH file
build-dh
[*]產生Server端金鑰
build-key-server server
[*]將Keys目錄中的ca.crt、dh1024.pem、server.crt、server.key複製到D:\OpenVPN\config
[*]執行Services.msc啟動服務管理員,將OpenVPNService設為自動,並啟用

Client部份

[*]產生Client端金鑰
vars
build-key client1 (產生過程中,Common Name必需改名,不可與產生過的重覆)
[*]將keys目錄下的ca.crt、client1.crt、client1.key複製到Client端的OpenVPN\config目錄下
[*]在OpenVPN\config下新增client.ovpn
        client
        dev tun
        proto udp
        remote 遠端主機的ip或是domain name 1194
        resolv-retry infinite
        nobind
        persist-key
        persist-tun
        ca ca.crt
        cert client1.crt
        key client1.key
        comp-lzo
        verb 3

Reference:
免費的OPENVPN,建立你的專屬區網 - Remhom 王仁宏- 點部落
http://www.dotblogs.com.tw/remhom/archive/2012/03/13/70717.aspx
[筆記] OpenVPN for windows 2008 輕鬆建立具有網際網路連線能力的私有網路環境 (單網卡) | 小豬愛分享
http://wangchihwei.blogspot.tw/2013/03/openvpn-for-windows-2008.html
RoutedLans – OpenVPN Community (iroute設定)
https://community.openvpn.net/openvpn/wiki/RoutedLans
頁: [1]
查看完整版本: 安裝OpenVPN Server (Windows)