February 2008 Archives

穿透防火牆-OpenVPN


OpenVPN.jpg

遇到這問題,第一個就是想到那套日本的SoftEther,但是後來便不再推出免費使用。且一定需要Licence key才能啟動,故只好轉向使用免費的OpenVPN
在Linux上,安裝OpenVPN,並設定成Server端。步驟如下:
1.安裝rpm。
2.將/usr/share/openvpn/easy-rsa整個目錄,複製到/etc/openvpn目錄下。
3.編輯vars檔,export D='/etc/openvpn',執行. ./vars。
4.執行./clean-all。
5.執行./build-ca產生ca.crt和ca.key檔案。
6.執行./build-dh產生Diffie-Hellman key。
7.執行./build-key-server server產生server.crt、server.csr和server.key。
8.執行./build-key client1產生client1.crt、client1.csr和client1.key。
9.編輯server.conf,依照需求修改其設定。
9.1 改為proto tcp 9.2 改push "route 192.168.X.0 255.255.255.0"
10.啟動openvpn。
11.Client端安裝(主要是Win32)。
12.將產生出來的ca.crt、client1.crt和client1.key,複製到C:\Program Files\OpenVPN\config目錄。
13.編輯client.ovpn。改成 proto tcp,指定剛產生的三個檔,ca ca.crt、cert client1.crt、key client1.key,remote public_ip_map_to_vpn_server 1194。
14.執行client.ovpn,便可連上Server。

這過程發生找不到ca檔,必須在server.conf中,在ca ca.crt上指定路徑,Ex:ca keys/ca.crt,其他server.crt、server.key、dh1024.pem皆需要。
另外,產生server.crt時,可能檔案大小為0,此時必須重新產生。
當然如果使用port 443,需將Apache conf檔,將443 port disable。
在Windows上,如需GUI畫面,可以另外下載OpenVPN GUI for Windows
此方法必須允許觀看網頁,如果公司連網頁都不能看,此方法無效。
參考資料:OpenVPN HOWTO
How to reach any of the other machines on the remote subnet.
1. On Ubuntu, You need to modify /etc/sysctl.conf, net.ipv4.conf.default.forwarding=1.
2. Add a static routing in default gateway, ex 10.8.0.0 netmask 255.255.255.0 VPN_Server_IP.

March 2010

Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Archives

Recent Entries

Powered by Movable Type 4.34-en

Recent Comments

  • panandy: 3Q read more
  • Anonymous: philipz大 沒有邀請碼,無法註冊,致無法下載工具 請問有何方法可以解決? 感恩 read more
  • philipz: harushard, It is your java code problem. Check it and read more
  • harushard: java.lang.NoClassDefFoundError: Could not initialize class examples.ExamplesMCRFactory could you explain why read more
  • philipz: IM已經是無解了,建議可以用Plurk Api試看看。 read more
  • ann: hi,請問以上問題解決了沒?可以分享一下嗎? read more
  • Anonymous: 邀請碼沒有~無法下載工具~~怎麼辦 read more
  • Melody: test read more
  • philipz: Ginger: 您好,請您在我的噗浪上留言即可一起討論。 read more
  • Ginger: 版大您好: 在看過您做的期貨即時訊息BOT後覺得很不錯,自己也有一些想法不知能否與您交流與協助呢? 若您覺得ok的話,可以email或是噗浪(ID: king0355)與我聯繫。感謝 : ) read more

About this Archive

This page is an archive of entries from February 2008 listed from newest to oldest.

January 2008 is the previous archive.

March 2008 is the next archive.

Find recent content on the main index or look in the archives to find all content.