分享]使用家中多出來的Android手機/平板電腦,架設OpenVPN Server翻牆

 [前言]祖國的網絡長城,越來越勁,最普遍的PPTP VPN已經好難翻牆,因為長城只要block咗往外地的PPTP port 1723的traffic,PPTP VPN已經可以話係廢咗武功(而PPTP的預設port是轉不到的,其他L2TP / IPSec VPN亦係同一原理),剛剛發現,OpenVPN可以改port翻牆,而且可以用Android機架設OpenVPN Server...


因家中有一台Android平板電腦,剛剛測試安裝OpenVPN Server成功了,換言之,只要你家中有一台唔用嘅嘅Android機,你就可以試下喺Android機架設OpenVPN Server喺祖國翻牆了...

當然,用Android機架設的OpenVPN Server,一般使用應該無乜問題的,但就唔好攞嚟BT了...

要喺Android機架設OpenVPN Server,你需要呢個Apps:

Servers Ultimate:

https://play.google.com/store/apps/details?id=com.icecoldapps.serversultimatepro

有Free版,但我唔知有無VPN Server set得到,因為我買咗 Pro版:

https://play.google.com/store/apps/details?id=com.icecoldapps.serversultimate&hl=zh_TW


Android機最好有root,唔root都得,不過唔root就用唔到1024以下嘅port...

點解要用1024以下嘅port?有啲port,長城係唔block得的,例如我剛剛測試OpenVPN時所使用的995,係pop3 SSL的port,如果長城block咗port 995,咁如果外地的Email server係用pop3 SSL先可以收信的話,用戶就唔可以喺大陸用郵件程式以pop3 SSL收信了,影響係非常之大的,講到呢度,我諗好多師兄都明白,將OpenVPN的port設置為995,其實就係要「冒充」pop3 SSL,「扮收信」,欺騙長城,如果Android機無root,預設係唔可以用1024以下的port的,用1024以上嘅port可以嗎?咁當然係可以的,不過用1024以下嘅port,「扮」其他有用嘅服務,咁應該會更好。當然,唔一定要用995,有啲長城唔block得嘅重要port都可以用,22(SSH)、443(htttps)等等,都係可以用的...

設定唔難,首先,當然係喺你的Android機安裝Servers Ultimate,然後打開,選第2項「Servers」,按頂頭「+」號,選擇「VPN Server」,呢個時候會彈你去Play Store下載VPN server插件,裝完個插件就可以繼續:



上圖,頂頭有4個Tab,先講「General」:

SERVER NAME : 求其比個名

VPN PORT : 求其比個port,1024以上

MANAGEMENT PORT : 管理用嘅port,同樣,求其比一個,1024以上

建議勾選:
Start on boot
Start directly when app starts

如果你部Android機有root,勾選:
Use root for internal port forwarding
然後下面port果度,打1024以下嘅port,例如我就打995

建議勾選:
Use UPnP for automatic port forwarding
Overwrite existing port mappings
Select UPnP gateway選Default

==================

第二個Tab 「Specific」:

勾選:

Use root when starting (如果你部機有root的話,無root就忽略呢個選項吧)

一路掃到最底,「CLIENT SERVER IP」一項,將%defaultlocalip%清除,輸入你自己屋企上網嘅IP:

其他保持唔郁

=================

第三個Tab,「Users」

呢度比你創建使用OpenVPN的Users,好簡單,唔多講

=================

設置好後,返去「Specific」呢個tab,碌到最底,喺「CLIENT DATA」項目,點選「Save」:



然後會有個vpnclientdata.zip嘅file叫你save,將個zip save落Android機的SD卡,用你自己嘅方法,send過去 PC,喺 PC 爆開個zip,你會見到有以下6個檔案:



上面6個檔案,其實即係OpenVPN嘅鎖匙,只要將呢串「鎖匙」,上傳去你嘅手機,再用OpenVPN Client開啟便可以使用VPN了...

步驟做好後,按螢幕右上角的「Save」按扭儲存,然後啟動「START」VPN Server:



當然,要喺街外連到屋企部Android機,要喺router做port forwarding:



我用port 995,上圖左邊係內網連接埠,右邊係外網連接埠

===================

開咗Server,當然就要用手機連入去了,Android機請下載OpenVPN Connect並安裝:

https://play.google.com/store/apps/details?id=net.openvpn.openvpn&hl=zh_HK

將剛才喺 PC 爆開zip檔後得到的「6串鎖匙」,上傳至要連接VPN果台手機的SD Card,打開OpenVPN Connect:

點選螢幕右上方的「3個方點」->Import->Import Profile from SD Card->搵返果「6串鎖匙」的位置->然後選擇client.ovpn

再輸入之前喺Servers Ultimate設置的使用者密碼,就可以連上VPN了:



由於我唔係用IOS,IOS點樣連上OpenVPN Server,我就節錄Servers Ultimate help page入面嘅內容吧,其實原理都係差唔多,同樣都係用果6把鎖匙:
Client
- Download and install the "OpenVPN Connect" app in App Store
- Connect the iOS device to a computer which has iTunes installed
- Get the zip package you received from the server and extract the content to a folder on the computer your iOS device is connected to
- Open "client.ovpn" with a text editor and check whether the line that looks like "remote IP PORT" and is not commented out (with a ;) has the correct IP and port from the running server. You might need to change this and save.
- Open iTunes > go to your device > go to Apps > go to File Sharing > select OpenVPN Connect > copy the contents of the folder on your computer to the OpenVPN documents field > press done
- Disconnect your iOS device and open OpenVPN Connect
- Click the plus sign under the new profiles available section > click on the connection toggle button > select yes on the popup
- If everything went correctly you should now be connected.
=======================

當然,如果你家中有24小時長開的電腦、支持OpenVPN Server的Router、NAS之類,你亦可以用呢個改port方法試試的,因為我唔想長時間著住家中電腦,又無支持OpenVPN的Router及NAS,咁我就唯有用呢個方案 -「以多出來的Android機架設OpenVPN Server」了...

而家喺香港連當然無問題,上到大陸就未知,剛剛先set好,而我呢一個月都未必會返上大陸,如果有師兄試過呢個方法係work,煩請告知!感激不盡!

當然,如果我嚟緊有機會返大陸,我亦都會試試,到時會再向大家匯報。

留言

這個網誌中的熱門文章

DeepNude 2.0 – Deepnude AI算法一键脱衣,绿色破解版,免费下载

用数字货币洗钱,警察蜀黍就没招了吗?| 浅黑笔记

最简单的Trojan一键脚本,效率高/速度快/延迟低,支持tls1.3,系统要求>=Centos7