15分鐘打造純凈F牆固件,科學上網,軟路由安裝Clash,不編譯,不用找ipk



懶人包:
https://github.com/wofei0531/clash_config/releases/tag/1.11

———————————————————————
第一步,準備工作

1. OPENWRT官方固件
https://openwrt.org/

2. Clash內核Premium版 + 配置文件
https://github.com/Dreamacro/clash/releases/tag/premium

3. Clash啟動腳本
——————————
把下面的代碼保存成一個UTF8編碼的文本,文件名clash
——————————
#!/bin/sh /etc/rc.common
START=90
USE_PROCD=1
start_service() {
procd_open_instance
procd_set_param command /usr/bin/clash/clash -d /root/.config/clash
procd_set_param respawn 300 0 5 # threshold, timeout, retry
procd_set_param file /root/.config/clash/config.yaml
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param pidfile /var/run/clash.pid
procd_close_instance
}
—————————————————————————
懶人包
https://github.com/wofei0531/clash_config/releases/tag/1.11
—————————————————————————
第二步,簡單設置一下 Openwrt IP地址,用Winscp上傳懶人包內三個文件夾,
需要 putty , winscp 兩個軟體

之後進行如下操作:
—————————————–
1,安裝依賴,複製粘貼就行了
—————————————–
opkg update

opkg install gnutls-utils
opkg install libgnutls
opkg install libmbedtls
opkg install libopenssl
opkg install libustream-openssl
opkg install libwebsockets-full
opkg install uhttpd
opkg install stubby
opkg install kmod-ipt-tproxy
opkg install iptables-mod-tproxy
opkg install luci-i18n-base-zh-cn
—————————————–

2,添加許可權
——————————
chmod +x /usr/bin/clash/clash
chmod +x /etc/init.d/clash

——————————

3,透明代理腳本
————————————
iptables -t nat -N CLASH
iptables -t nat -A CLASH -d 0.0.0.0/8 -j RETURN
iptables -t nat -A CLASH -d 10.0.0.0/8 -j RETURN
iptables -t nat -A CLASH -d 127.0.0.0/8 -j RETURN
iptables -t nat -A CLASH -d 192.168.0.0/16 -j RETURN
iptables -t nat -A CLASH -p tcp -j REDIRECT –to-ports 17891
iptables -t nat -A PREROUTING -p tcp -j CLASH
ip rule add fwmark 1 table 100
ip route add local 0.0.0.0/0 dev lo table 100
iptables -t mangle -N CLASH
iptables -t mangle -A CLASH -d 0.0.0.0/8 -j RETURN
iptables -t mangle -A CLASH -d 10.0.0.0/8 -j RETURN
iptables -t mangle -A CLASH -d 127.0.0.0/8 -j RETURN
iptables -t mangle -A CLASH -d 192.168.0.0/16 -j RETURN
iptables -t nat -N CLASH_DNS
iptables -t nat -A CLASH_DNS -p udp –dport 53 -j REDIRECT –to-port 1053
iptables -t nat -I PREROUTING -p udp –dport 53 -j REDIRECT –to 1053
iptables -t mangle -A CLASH -p udp -j TPROXY –on-port 17891 –tproxy-mark 1
iptables -t mangle -A PREROUTING -p udp -j CLASH

3 comments
  1. 鞠躬感謝您無私的教程,我在油管上找了N多的教學視頻,只有您的教學視頻是真正的無私的視頻,而且是邏輯清晰的教程。

Comments are closed.