close
附註:本文僅屬記錄與經驗分享且在非乾淨電腦中安裝,若有遺漏或錯誤煩請指正,如有侵權請來信告知。
[expand title="發表日期:2014/04/28 最後更新:2014/05/07" alt="點選觀看詳細更新記錄"]

  • 2014/04/28, 新增文章

  • 2014/05/07,  增強閱讀性


[/expand]


0.目錄



  1. 簡介

  2. 安裝環境

  3. 方法說明

  4. 參考資料

  5. 後記












1.簡介



  • VPN - Virtual Private Network 虛擬私人網路,常見於公司與學校機關中,利用加密的通道協議在公開的網際網路中建立一條私人的通道,即使身處不同的地點,也能透過通道虛擬出在同一個網路環境中的連線。

  • 常見的VPN協議有:(詳見維基百科)


  • 本文透過QNAP提供之OpenVPN服務建立自己的虛擬私人網路



2.安裝環境



  • Windows 7 x64

  • QNAP TS-412 (韌體版本:4.0.7) (機器是否支援VPN請至QNAP官網查詢,或詢問客服人員)

  • 使用軟體:OpenVPN 2.3.3 (Windows Installer 64-bit)



3.方法說明



  • 首先開啟QNAP中的OpenVPN服務

    • 登入QNAP管理介面

    • 選擇應用服務 > VPN服務 > VPN伺服器設定 > 啟動OpenVPN VPN伺服器 (其他暫時保留預設)

    • 點選套用後等待設定跑完QNAP就啟動VPN服務了

    • 點選下載設定檔,以提供Client端使用(會下載openvpn.zip,內含會用到的Config及簽章)

    • [caption id="attachment_418" align="aligncenter" width="650"][VPN]三分鐘自己架VPN - 使用QNAP 開啟QNAP中的OpenVPN服務[/caption]




 

  • 接著下載並安裝OpenVPN Client

    • 進入OpenVPN官網下載OpenVPN 2.3.3安裝檔案,請依照個人需求下載並安裝

    • 安裝步驟筆者全採用預設值,預設安裝路徑在C:\Program Files\OpenVPN

    • 解壓縮QNAP下載的設定檔,將裡面的檔案複製到OpenVPN安裝路徑下的config資料夾中(筆者路徑為:C:\Program Files\OpenVPN\config)

    • [caption id="attachment_419" align="aligncenter" width="351"][VPN]三分鐘自己架VPN - 使用QNAP 將設定檔及簽章放入config資料夾中[/caption]




 

  • 執行OpenVPN GUI並連線

    • 開啟OpenVPN GUI程式,務必使用系統管理員身分執行 (右鍵 > 以系統管理員身分執行)

    • 在右下方工具列就可以看到一個上鎖的電腦圖案,尚未連線的狀態圖案為灰色的

    • 在圖案上點選右鍵 > 連線



    • [caption id="attachment_420" align="aligncenter" width="202"][VPN]三分鐘自己架VPN - 使用QNAP 開始連線[/caption]

    • 成功的話就會跳出輸入使用者帳密的視窗(如圖)

    • [caption id="attachment_421" align="aligncenter" width="510"][VPN]三分鐘自己架VPN - 使用QNAP VPN登入[/caption]



    • 輸入QNAP中的VPN帳戶資料登入(請到QNAP之 應用服務 > VPN服務 > VPN用戶管理 進行新增與設定)

    • 成功登入會跳出連線通知

    • [caption id="attachment_423" align="aligncenter" width="241"][VPN]三分鐘自己架VPN - 使用QNAP 成功連線通知[/caption]

    • 以及連線的詳細資料

    • [caption id="attachment_422" align="aligncenter" width="510"][VPN]三分鐘自己架VPN - 使用QNAP 連線的詳細資料[/caption]

    • 接著就可以成功使用內部網路資源了




 

  • 其他注意事項

    • 在QNAP之VPN伺服器進階設定中,可以調整伺服器連接阜,預設為1194,最大連線數量預設5個,加密方式預設AES 128-bit

    • 如果像筆者QNAP不是直接連線掛上廣域網路,而是架在路由器後方,記得設定Port轉傳(NAT)才能順利連線

    • 記得到QNAP之 應用服務 > VPN服務 > VPN用戶管理 進行新增與設定,有設定的帳號才能使用VPN功能

    • 如果使用Win7以上之系統可能需要設定或關閉防火牆,才能正常連線




 

  • 其他資料:(以下截自QNAP下載之設定檔中,readme內容



  • [expand title="Qnap readme" alt="點選觀看詳細內容" elwraptag="div" elwrapclass="blueblaster"]

    To set up a client of OpenVPN on Windows :


    1. Install OpenVPN client on Windows
    -- Download OpenVPN from http://openvpn.net/index.php/open-source/downloads.html
    -- Install the OpenVPN client for Windowns.
    -- The default installation directory is C:\Program Files\OpenVPN.

    2. Run OpenVPN GUI as administrator.

    3. Download openvpn configuration file and certificate from NAS OpenVPN server.

    4. Edit openvpn.ovpn and replace OPENVPN_SERVER_IP(YOUR_IP_ADDR) with openvpn server IP.

    5. Put "ca.crt" and "openvpn.ovpn" into the configuration folder under OpenVPN configuration subdirectory (ie. C:\Program Files\OpenVPN\config).

    6. If the OpenVPN clients of your operating system is win7, add the firewall rules in input routes of advanced setting for OPENVPN.

    7. If your firewall AP is others, you have to modify it for OPENVPN ICMP network control protocol.

    =============================================================================================
    To set up a client of OpenVPN on Linux :

    1. Install OpenVPN client on Linux
    -- Download OpenVPN from http://openvpn.net/index.php/open-source/downloads.html
    -- Install the OpenVPN client for Linux.

    2. Download openvpn configuration file and certificate from NAS OpenVPN server.

    3. Edit openvpn.ovpn and replace OPENVPN_SERVER_IP(YOUR_IP_ADDR) with openvpn server IP.

    4. Put "ca.crt" and "openvpn.ovpn" into the configuration folder under OpenVPN configuration subdirectory.

    5. Run OpenVPN.

    6. For more information refer to official documentation please.
    OpenVPN http://openvpn.net/index.php/open-source/documentation.html for more information.
    =============================================================================================
    To set up a client of OpenVPN on MAC :

    1. Install OpenVPN client on MAC
    -- Download the disk image of OpenVPN Client from http://code.google.com/p/tunnelblick/
    -- Launch Tunnelblick automatically.

    2. Download openvpn configuration file and certificate from NAS OpenVPN server.

    3. Edit openvpn.ovpn and replace OPENVPN_SERVER_IP(YOUR_IP_ADDR) with openvpn server IP.

    4. Put "ca.crt" and "openvpn.ovpn" into the configuration folder under OpenVPN configuration subdirectory.

    5. Run OpenVPN.

    6. For more information refer to
    http://www.zeroshell.net/eng/openvpn-client/#OpenVPN-GUI-MacOSX for more information.
    [/expand]




4.參考資料





5.後記



  • 打拼論文之際,常常需要透過學校取得論文資源。但離開學校就無法直接下載論文,雖然學校有提供VPN不過感覺不是很方便,(似乎還有連線限制)

  • 原本是宿舍電腦開著,要用的時候遠端回學校下載,不過感覺依然不方便,剛好發現手上的QNAP機器有VPN的選項可以使用

  • 終於在今天設定了一下,扣掉安裝的時間,點幾個選項不用3分鐘就安裝完成了,要使用只要連線一下走到哪用到哪,感覺方便許多。

  • 而且透過QNAP可以直接管理使用者,像是中小企業或公司內部要使用時,不用每個人都使用同一組帳號,可以每個人分配一組帳號,方便管理。

arrow
arrow
    全站熱搜

    Robarter 發表在 痞客邦 留言(0) 人氣()