OpenWrt自己用 shadowsocks 访问网络

391 views
Skip to first unread message

Xi Shen

unread,
Sep 5, 2015, 2:48:24 AM9/5/15
to Shanghai Linux User Group

Hi,

买了小米路由器,刷了 openwrt 。也配置了 ss 。都好用。但是发现一个问题,路由自己不能用 ss ,结果就是在路由上装软件的时候经常失败。

download. openwrt.com 好像没有被认证,但是不用 ss 就会经常断掉。。。

有什么办法让路由自己也可以用 ss 吗?

我试了 tsocks ,但是不成功。不知道是不能这样,还是没有弄对。

Thx,
David

--

Regards,
David

Shell Xu

unread,
Sep 5, 2015, 11:23:12 PM9/5/15
to shlug
easy。把你的路由器带到全局科学的一个网络里去。
BTW。上次是谁问我什么情况下才会用到非路由器全局科学不可这么一种特殊场景的。现在不是来了么?在使用路由器的情况下。

--

Regards,
David

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout



--
彼節者有間,而刀刃者無厚;以無厚入有間,恢恢乎其於游刃必有餘地矣。
blog: http://shell909090.org/blog/

Heiher

unread,
Sep 5, 2015, 11:30:42 PM9/5/15
to shlug
shadowsocks 本质上不是仅提供个 socks5 代理吗?应该还有个服务类似 socks5 客户端配合着 iptables 进行着
TPROXY。你应该只需要在 router 上配置个 REDIRECT 规则就可以了。

iptables -t nat -A OUTPUT -d xxx.xxx.xxx.xxx/32 -j RETURN # bypass 地址
iptables -t nat -A OUTPUT -d 0.0.0.0/8 -j RETURN
iptables -t nat -A OUTPUT -d 10.0.0.0/8 -j RETURN
iptables -t nat -A OUTPUT -d 127.0.0.0/8 -j RETURN
iptables -t nat -A OUTPUT -d 169.254.0.0/16 -j RETURN
iptables -t nat -A OUTPUT -d 172.16.0.0/12 -j RETURN
iptables -t nat -A OUTPUT -d 192.168.0.0/16 -j RETURN
iptables -t nat -A OUTPUT -d 224.0.0.0/4 -j RETURN
iptables -t nat -A OUTPUT -d 240.0.0.0/4 -j RETURN
iptables -t nat -A OUTPUT -p udp -m udp --dport 53 -j REDIRECT
--to-ports 5300 # 5300 端口是 DNS UDP 转 TCP 服务,根据实际端口修改。
iptables -t nat -A OUTPUT -p tcp -j REDIRECT --to-ports 10800 # 是 TCP
重定向服务(经过 socsk5 代理访问)
Best regards!
Heiher
http://hev.cc

Shell Xu

unread,
Sep 5, 2015, 11:35:15 PM9/5/15
to shlug
有。tun2sock。
不建议这么干。

您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要查看更多选项,请访问 https://groups.google.com/d/optout

Rivsen

unread,
Sep 5, 2015, 11:56:36 PM9/5/15
to shlug

我用ipset配合dnsmasq做白名单


Shell Xu <shell...@gmail.com>于2015年9月6日周日 11:35写道:
--

Send from my Nexus 5.

Xi Shen

unread,
Sep 6, 2015, 4:27:40 AM9/6/15
to shlug

写 iptable rule 太麻烦。我也不太会有。之前说的 tsocks 好像真的不能再 openwrt 上工作。回去看看 tun2socks 是能不能用。

现在的解决方案比较偷懒。。。用中科大的景象 😅

Regards,
David

Heiher

unread,
Sep 6, 2015, 8:51:28 PM9/6/15
to shlug
如果仅是特定的应用程序,就建议使用应用内的代理设置,如 curl 就支持 socks5 代理。想全局透明启用代理,我我会选择使用 iptables REDIRECT target 来做,简单高效。

shang jiyu

unread,
Sep 8, 2015, 1:01:08 PM9/8/15
to Shanghai Linux User Group
只是软件包的话 可以替换国内的镜像源,类似 openwrt.bobiji.com

在 2015年9月5日星期六 UTC+8下午2:48:24,Xi Shen写道:

Xi Shen

unread,
Sep 8, 2015, 8:40:22 PM9/8/15
to Shanghai Linux User Group
我用的是 https://lug.ustc.edu.cn/wiki/mirrors/help/openwrt,也不错。

163, aliyun什么的都没有openwrt的镜像。。。


--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要查看更多选项,请访问https://groups.google.com/d/optout
--

Regards,
David

Reply all
Reply to author
Forward
0 new messages