• 4

[分享] Synology NAS DSM 3.2 and VPN Support [PPTP and OpenVPN on Windows and Linux]

rajatim wrote:
我只能說你的設定一定...(恕刪)


rajatim大非常不好意思~
在下絕對沒有惡意,但是絕對是缺了禮貌,
如有讓您感到不舒服的地方,還請您見諒
我的修改和設定步驟如下:
啟動VPN功能


以putty登入至openvpn修改


解壓縮openvpn.zip至confing資料夾下

修改openvpn.conf內容

連線後出現log訊息

Fri Sep 30 16:21:27 2011 OpenVPN 2.2.1 Win32-MSVC++ [SSL] [LZO2] built on Jul 1 2011
Fri Sep 30 16:21:33 2011 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Fri Sep 30 16:21:33 2011 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Fri Sep 30 16:21:33 2011 LZO compression initialized
Fri Sep 30 16:21:33 2011 UDPv4 link local (bound): [undef]:1194
Fri Sep 30 16:21:33 2011 UDPv4 link remote: 180.xxx.xxx.xxx:443
Fri Sep 30 16:22:33 2011 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Fri Sep 30 16:22:33 2011 TLS Error: TLS handshake failed
Fri Sep 30 16:22:33 2011 SIGUSR1[soft,tls-error] received, process restarting


starbiker wrote:
rajatim大非常...(恕刪)


不好意思...昨天小弟也被老婆教訓一頓了...這裡跟您道歉...對不起..少禮數了...

感覺上設定檔案是都正確的,而是Client和Server端互相無法認證。

問題在此:
Fri Sep 30 16:22:33 2011 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Fri Sep 30 16:22:33 2011 TLS Error: TLS handshake failed


小弟大概有幾個方向,依照機率大小順序寫下:
1. 如果您1194是可以連線的話,那麼443是屬於郵件伺服器會使用到的Port,煩請檢查是否有一起使用到郵件伺服器,造成port衝突;另一個角度就是防火牆,不論是Server端或是Client端防火牆還是中間的網路設備是否有阻擋到443的UDP,或許嘗試使用443的TCP連線看看,如果可以正確連線的話,再使用UDP試試。

2. 想請問在Server端的chmod u-w openvpn.conf是否會被官方修改,小弟在安裝期間,發現官方並非每次都會修改回復這個檔案

3. 設定檔案之間,沒有編碼問題造成key路徑錯誤...雖然這機率很低。

4. 中間是否有重新安裝過套件,因為不知道Synology產生ca.crt的時機在哪邊,重新下載一次ca.crt試試看?

還是覺得防火牆問題或是防毒軟體阻擋了Port比較可能。
Synology的DSM的防火牆很好設定,防火牆設定頁下方也有例外是否預設封鎖還是放行。
防火牆埠號: 1194, 1195, 443 TCP和UDP都先打開,測試之後再慢慢關閉也可。

目前人在外面,機器不在身邊,無法提供畫面,還請見諒了。


附上OpenVPN官方對於這個錯誤的解釋:
http://openvpn.net/index.php/open-source/faq/79-client/253-tls-error-tls-key-negotiation-failed-to-occur-within-60-seconds-check-your-network-connectivity.html
You get the error message: TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity). This error indicates that the client was unable to establish a network connection with the server.

Solutions:

Make sure the client is using the correct hostname/IP address and port number which will allow it to reach the OpenVPN server.

If the OpenVPN server machine is a single-NIC box inside a protected LAN, make sure you are using a correct port forward rule on the server\'s gateway firewall. For example, suppose your OpenVPN box is at 192.168.4.4 inside the firewall, listening for client connections on UDP port 1194. The NAT gateway servicing the 192.168.4.x subnet should have a port forward rule that says forward UDP port 1194 from my public IP address to 192.168.4.4.

Open up the server\'s firewall to allow incoming connections to UDP port 1194 (or whatever TCP/UDP port you have configured in the server config file).

昨天狠下心將NAS格式化重新安裝
再把UDP改為TCP,終於順利連線了!
實在對rajatim大萬分感謝!
您的教學真是讓在下獲益良多!
連線LOG內容如下:
Mon Oct 03 13:27:33 2011 OpenVPN 2.2.1 Win32-MSVC++ [SSL] [LZO2] built on Jul 1 2011
Mon Oct 03 13:27:42 2011 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Mon Oct 03 13:27:42 2011 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Mon Oct 03 13:27:42 2011 LZO compression initialized
Mon Oct 03 13:27:42 2011 Attempting to establish TCP connection with 180.177.160.99:443
Mon Oct 03 13:27:42 2011 TCP connection established with 180.xxx.xxx.xxx:443
Mon Oct 03 13:27:42 2011 TCPv4_CLIENT link local: [undef]
Mon Oct 03 13:27:42 2011 TCPv4_CLIENT link remote: 180.xxx.xxx.xxx:443
Mon Oct 03 13:27:42 2011 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Mon Oct 03 13:27:44 2011 [Snake_Oil_CA] Peer Connection Initiated with 180.177.160.99:443
Mon Oct 03 13:27:46 2011 TAP-WIN32 device [區域連線 9] opened: \\.\Global\{D87F5FD5-8564-40C3-B226-A28232054B7D}.tap
Mon Oct 03 13:27:46 2011 Notified TAP-Win32 driver to set a DHCP IP/netmask of 10.8.0.6/255.255.255.252 on interface {D87F5FD5-8564-40C3-B226-A28232054B7D} [DHCP-serv: 10.8.0.5, lease-time: 31536000]
Mon Oct 03 13:27:46 2011 Successful ARP Flush on interface [3] {D87F5FD5-8564-40C3-B226-A28232054B7D}
Mon Oct 03 13:27:51 2011 WARNING: potential route subnet conflict between local LAN [10.8.0.4/255.255.255.252] and remote VPN [10.8.0.0/255.255.255.0]
Mon Oct 03 13:27:51 2011 Initialization Sequence Completed
rajatim大您提到openvpn.conf被更改的情況,在下沒遇到過
另請教您連線後可以用"http://NAS-IP:5000"登入NAS嗎?




starbiker wrote:
昨天狠下心將NAS格...(恕刪)


問題應該在於你的第四張圖的第一行,Synology有做Push Route的動作,這行看起來是官方依據設定加進去的,可是你貼上來的連線紀錄沒看到push,所以要你檢查一下server的openvpn啟動之後,是否有加入這行。
starbiker wrote:
昨天狠下心將NAS格...(恕刪)


今天在安裝 QNap OpenVPN 套件時也是遇到類似的問題, VPN Tunnel 一直建立不起來, 後來轉而試看看 Synology OpenVPN, 結果和 starbiker 兄遇到的狀況及訊息都類似. (小弟之前也安裝過 Synology OpenVPN, 當時安裝時都很順利, 此次重新再試一次 OpenVPN 只為驗證之用)

後來改為 TCP 443 port, 竟然就 ok 了. 這段期間小弟唯一有更改的是, 原本都是使用 Windows XP, 而近日電腦昇級為 Windows 7. 這是我想到唯一不同之處.
FB: Pctine
Dear rajatim大大...

感謝你的分享... 小弟有個笨問題... 關於貴公司用VPN分享給在外面出差的員工部分... 請問要支援這個功能公司網路需要固定IP嗎?

david269 wrote:
Dear rajat...(恕刪)


搭配DDNS功能即可~ 恩,祝使用愉快~
如果我用TOMATO 的OPENVPN 作Client 要如何設定?
謝!!
發文大你好

目前pptp 得模式下執行沒有問題,但請問在這個vpn 套件裏頭,是否可以更改pptp的 port number

呢?

謝謝您

wunelson wrote:
發文大你好

目前pptp 得模式下執行沒有問題,但請問在這個vpn 套件裡頭,是否可以更改pptp的 port number

呢?

謝謝您...(恕刪)


pptp port 目前不能改。不過如果在 router 後面的話,可以透過 port forward 的對應,對外可以是不同的 port
  • 4
內文搜尋
X
評分
評分
複製連結
Mobile01提醒您
您目前瀏覽的是行動版網頁
是否切換到電腦版網頁呢?