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.