asuswrt-merlin係華碩router嘅增強版第三方firmware,flash咗呢個firmware之後,你嘅router就會變為一個Linux Server,功能強大,威力無窮,請到
https://asuswrt.lostrealm.ca/搵到你型號嘅firmware,安裝手冊 https://github.com/RMerl/asuswrt-merlin/wiki
shadowsocks-libev係一個用C寫嘅shadowsocks分支,屬變形嘅socks5代理工具,支援多種加密方式,並有混淆流量偽裝插件,主要用嚟規避贏國嘅GFW
https://github.com/shadowsocks/shadowsocks-libev
以下安裝shadowsocks-libev以Asus RT-AC68U為例
flash咗做merlin firmware之後,login去router控制頁面,去系統管理,搵到呢2個部份照圖設定
之後搵隻8GB以上USB手指,插去router嘅usb port第一個,喺Linux用ssh login去router
$ ssh yourname@192.168.1.1
windows就安裝putty,可以搵個免安裝portable嘅
https://portableapps.com/apps/internet/putty_portable
同樣ssh入去
入到router命令行,輸入entware-setup.sh
詳細請睇https://github.com/RMerl/asuswrt-merlin/wiki/Entware]
等佢完成,之後要搞個DDNS,因為家用嘅寬頻通常非固定IP,需要用Domain指向當時IP連接,華碩官方嘅DDNS設置
https://www.asus.com/hk/support/FAQ/1011725/
如果唔鍾意呢啲DDNS供應商,可以參考 https://github.com/RMerl/asuswrt-merlin/wiki/Custom-DDNS用其它嘅供應商,我係用非華碩提供嘅,因為好多喺贏國block咗
搞掂咗DDNS之後,喺ROUTER命令列輸入
opkg list | grep shadowsocks-libev 會output呢堆
shadowsocks-libev-config - 3.1.3-2 - shadowsocks-libev config scripts
shadowsocks-libev-polarssl - 2.4.5-1
shadowsocks-libev-ss-local - 3.1.3-2 - shadowsocks-libev ss-local
shadowsocks-libev-ss-redir - 3.1.3-2 - shadowsocks-libev ss-redir
shadowsocks-libev-ss-rules - 3.1.3-2 - shadowsocks-libev ss-rules
shadowsocks-libev-ss-server - 3.1.3-2 - shadowsocks-libev ss-server
shadowsocks-libev-ss-tunnel - 3.1.3-2 - shadowsocks-libev ss-tunnel
唔需要佢其他嘅嘢,只要server, 再輸入
opkg install shadowsocks-libev-ss-server
等安裝完成,轉去 /jffs/scripts path , 輸入
cd /jffs/scripts/
睇吓有冇文字編輯器,輸入 which nano,冇就 opkg install nano,之後輸入
nano ss-init , 內容如下 https://pastebin.com/raw/wgsJ8uCn
如果懶copy&paste,輸入
wget --no-check-certificate -q https://pastebin.com/raw/wgsJ8uCn -O ss-init
之後輸入 chmod +x ss-init , 睇吓/jffs/scripts 有冇firewall-start 呢個file,輸入 ls ,有就喺內容後面加入,冇就開新嘅,file名一定係firewall-start
iptables -I INPUT -p tcp --dport 9089 -j ACCEPT
iptables -I INPUT -p udp --dport 9089 -j ACCEPT
上面9089個port係可以改嘅,配合返ss嘅config file就得,轉頭會講,搞完記得chmod +x firewall-start
跟住 nano services-start ,喺後面加入
/jffs/scripts/ss-init start
cronfile="/jffs/scripts/admin"
dest="/var/spool/cron/crontabs/"
/bin/cp "$cronfile" "$dest"
save之後跟住nano services-stop ,喺 /opt/etc/init.d/rc.unslung stop 呢行前面加入
/jffs/scripts/ss-init stop
save咗跟住nano admin , 裏面內容
*/15 * * * * /jffs/scripts/isup.sh
59 23 * * * /opt/bin/opkg update && /opt/bin/opkg upgrade
save咗nano isup.sh, 裏面內容 https://pastebin.com/raw/a2bAYyeT
#! /bin/sh
ss=$(ps w | awk '$5 ~ /ss-server/{print $1}')
if [ -n "$ss" ]
then
:
else
/jffs/scripts/ss-init start
fi
exit 0
如果懶得打就同上面玩法一樣,下載落嚟之後 chmod +x isup.sh
到呢度 /jffs/scripts 裏面要嘅嘢有晒,轉去 /mnt/sda1/entware/etc/
cd /mnt/sda1/entware/etc/ 之後輸入 mkdir shadowsocks ,完成 cd shadowsocks
然後nano config.json , 裏面內容
{
"server":"0.0.0.0",
"server_port":9089,
"password":"Your_password_here_need_change",
"local_port":1080,
"timeout":600,
"method":"chacha20-ietf-poly1305",
"fast_open":false,
"workers":1
}
save咗就完成需要嘅嘢,會隨開router啟動ss server,並自動15分鐘check ss server係咪運行,死咗會自動重開,config.json裏面個server port可以改成你鍾意嘅,冇其它嘢用緊就得,當然要改返firewall-start裏面個port
之後命令列輸入 /jffs/scripts/ss-init start ,就運行 ss server
/jffs/scripts/ss-init stop 就停服務,/jffs/scripts/ss-init status就睇運行狀態
客戶端喺ios嘅 app store輸入shadowsocks一堆,有收錢有免費,我用緊shadowrocket,以前8蚊 https://itunes.apple.com/hk/app/shadowrocket/id932747118?mt=8
或者google "ios shadowsocks客戶端"睇吓邊隻啱用
android就用作者嘅官方client最好
https://play.google.com/store/apps/details?id=com.github.shadowsocks&hl=zh_HK
client嘅設置同config.json相同就得,server就係DDNS嘅Domain
呢個設置主要為個人使用,或2個人用,原因router硬件好雞吓,驚唔穩定,如果多人用嘅話最好用VPS搞,每人唔同密碼唔同port,或者用NAS搞較為好啲
呢樣嘢主要係for有需要返贏國嘅人,或去外地旅行又要通過香港IP買波買馬,又或者不明WIFI之下安全起見用代理連接網絡
由於小弟唔係IT狗,所有嘢都係自學,有bug/錯唔奇,巴打請指出