找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 20913|回复: 66

s-s用ipset更智能更节约流量

  [复制链接]
朋友弄了个vps,价格便宜但是每月有流量限制,用s-s-libev-spec+china-dns配置简单但是外面IP都全翻了,很不环保。

参考了网上的教程,做了个简易教程。

教程基于openwrt官方14.07固件,使用s-s-libev+ipset+dnsmasq-full+china-dns,如下:
1.安装必要的组件
  1. opkg update

  2. opkg install ipset ip iptables-mod-nat-extra
复制代码
先去下载s-s-libevl,用winscp上传到/tmp
  1. opkg install /tmp/*.ipk
复制代码
2.卸载固件自带的dnsmasq,安装dnsmasq-full
  1. /etc/init.d/dnsmasq stop
  2. opkg remove dnsmasq
  3. rm -rf /etc/config/dhcp
  4. opkg install dnsmasq-full
  5. /etc/init.d/dnsmasq start
复制代码
3.把附件解压后用winscp丢到路由上对应目录,注意权限。

4.安装s-s-libev后修改/etc/s-s.json,必须要有这行"local": "0.0.0.0",不然就是全翻了。具体如下:
  1. {
  2.     "server": "服务器",
  3.     "server_port": 服务器端口,
  4.     "local": "0.0.0.0",
  5.     "local_port": 1080,
  6.     "password": "服务器密码",
  7.     "timeout": 600,
  8.     "method": "加密方式"
  9. }
复制代码
5.修改/etc/init.d/s-s如下
  1. #!/bin/sh /etc/rc.common

  2. START=95

  3. SERVICE_USE_PID=1
  4. SERVICE_WRITE_PID=1
  5. SERVICE_DAEMONIZE=1

  6. CONFIG=/etc/s-s.json

  7. start() {
  8.         #service_start /usr/bin/ss-local -c $CONFIG -b 0.0.0.0
  9.         service_start /usr/bin/ss-redir -c $CONFIG -b 0.0.0.0
  10.         #service_start /usr/bin/ss-tunnel -c $CONFIG -b 0.0.0.0 -l 5353 -L 8.8.8.8:53 -u
  11. }

  12. stop() {
  13.         #service_stop /usr/bin/ss-local
  14.         service_stop /usr/bin/ss-redir
  15.         #service_stop /usr/bin/ss-tunnel
  16. }
复制代码
6.设置开机启动
  1. /etc/init.d/s-s enable
复制代码
7.重启


后记:s-s有时开机不能自动启动,附加加个计划任务
  1. */2 * * * * /etc/checks-s.sh
复制代码



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

评分

参与人数 1恩山币 +1 收起 理由
ivy*** + 1 我一直用这种方法。

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
make

点评

是你的搬瓦工吧?  详情 回复 发表于 2017-1-3 15:41
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

这个性能比china-dns稍弱

点评

chinadns默认是外面IP都翻的,亚马逊本来就能直接登录,明白?  详情 回复 发表于 2015-4-2 12:33
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

标个记号
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
本帖最后由 99010 于 2015-4-2 12:56 编辑
jasonkarl 发表于 2015-4-2 12:24
这个性能比chinadns稍弱

chinadns+SS默认是外面IP都翻的,而亚马逊本来就能直接登录,明白?

点评

我可说不明白了?我说的是这个方法性能比白名单ChnRoute弱明白?  详情 回复 发表于 2015-4-2 15:50
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

openwrt是万能的,没有money万万不能openwrt。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

mark 一下。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

我也喜欢这样的方式,我用的iptable比较麻烦,一个一个加上去的,没有屏蔽的网站直接连接确实方便很多,chinadns一刀切,ss服务器装了speeder双倍流量的伤不起。

点评

这个教程只用到一个iptable命令  详情 回复 发表于 2015-4-2 13:41
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
kmper 发表于 2015-4-2 13:39
我也喜欢这样的方式,我用的iptable比较麻烦,一个一个加上去的,没有屏蔽的网站直接连接确实方便很多,chi ...

这个教程只用到一个iptable命令
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

ZTE Q7 刷了openwrt测试成功,运行完美

点评

请问你刷的哪个固件,我也买了个Q7,我刷的pandorabox官网那个,安装不了ss,还请指教一下,只想用USB3G和科学上网,其它功能不要,怎么弄 Unknown package 'shadowsocks-libev'. Collected errors: * pkg_hash_  详情 回复 发表于 2015-4-13 22:31
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

这是哪些会翻?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

99010 发表于 2015-4-2 12:33
chinadns+SS默认是外面IP都翻的,而亚马逊本来就能直接登录,明白?

我可说不明白了?我说的是这个方法性能比白名单ChnRoute弱明白?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

chinadns是一刀切,国外流量全部走SS,当然准确率很高,就是浪费流量,本来没有被gfw的也走ss,速度受到影响还消耗ss流量。
楼主的方法是被gfw屏蔽的网站走ss,其余的直接连接,但是gfw经常升级,所以肯定比不上chinadns那么准确,但是消耗流量少,特别是挂PT的用户,以前用chinadns一天跑了300g流量,呵呵。
反正各有各的好处,看情况取舍,反正我是自己一条一条加的规则,从http://wq.apnic.net/apnic-bin/whois.pl查询ip段然后加入名单。

点评

楼主的conf文件看了吗?是8.8.8.8解析,dns污染怎么破? 最好的方法是/etc/init.d/shadowsocks 这个文件这么写 #!/bin/sh /etc/rc.common START=95 SERVICE_USE_PID=1 SERVICE_WRITE_PID=1 SERVICE_DAEMONI  详情 回复 发表于 2015-4-2 18:15
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

晕,扣了币,无法下载
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

我是来学习的,初来乍到,多多包涵。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-28 06:23

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表