找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 35257|回复: 33

Openwrt高级应用之9:路由器使用* + Privoxy 快速兲朝上网

  [复制链接]
前提,你必须要有一个服务器运行了*服务器端,并配置好正常运行。
本文适合玩vps的朋友,
server端安装见:http://s-s.org/en/download/servers.html (需要兲朝上网)


*相比其他上网方法,速度快,占用资源小,客户端不必安装过重的python库,特别是路由器客户端经过重写,并发和速度都很好。






1. 下载必备软件:
http://s-s.org/en/download/clients.html


s-s-libev-polarssl:




2. 路由器安装libpolarssl 库
可以在make menuconfig 编译固件的时候选择,也可以使用opkg update 源安装(适合12.09 release)




3. 安装privoxy 代理
方法同上,make menuconfig 或者opkg install privoxy


4. 安装*客户端,将ipk复制到路由器/tmp目录,并用 opkg install /tmp/xxxx.ipk 安装




5. 由于目前*只支持trunk,12.09上启动会报错,lib找不到,所以在12.09 AA 上安装的解决方法就是
root@gate:~# /etc/init.d/s-s start /usr/bin/ss-local: can't load library 'libpolarssl.so.3'


在12.09上将/usr/lib 下libpolarssl.so.2复制成libpolarssl.so.3,s-s可以启动



6. 更新:1月19日后,这个问题似乎已被作者修复,请编译的时候测试,如果问题还在,请按照如下修改


由于openwrt一个已知问题,service stop ss后台进程没有被正常关闭,这是 OpenWRT 上管理脚本的一个已知问题,可以通过 killall ss-local 确保所有进程被正常关闭。故修改三个函数:
/etc/init.d/s-s


start() {
killall ss-local
service_start /usr/bin/ss-local -c /etc/config/s-s.json -f /var/run/s-s.pid
}

stop() {
service_stop /usr/bin/ss-local
killall ss-local
}

restart() {
service_stop /usr/bin/ss-local
killall ss-local
service_start /usr/bin/ss-local -c /etc/config/s-s.json -f /var/run/s-s.pid

}



7. 配置/etc/config/s-s.json 配置服务器信息和加密方法

{
    "server":"111.22.333.444",
    "server_port":888,
    "local_port":1080,
    "password":"12345678",
    "timeout":600,
    "method":null
}


其中,local port为SS本地服务端口,server port为远程服务器的服务端口,密码和加密方法在服务器端配置,客户端必须和服务器端保持一致。

8. 配置privoxy,/etc/privoxy/config 配置代理端口,将所有请求转发到ss的服务端口1080上,除了某些白名单直连,并且关闭其他过滤功能。
config中需要配置的字段


listen-address  192.168.100.1:8118
局域网服务端口


关闭所有过滤功能,不使用actionfile
修改permit access允许局域网访问


#actionsfile match-all.action # Actions that are applied to all sites and maybe overruled later on.
#actionsfile default.action   # Main actions file
#actionsfile user.action      # User customizations

toggle  0
enable-remote-toggle  0
enable-remote-http-toggle  0
enable-edit-actions 0
enforce-blocks 0
buffer-limit 4096
forwarded-connect-retries  0
accept-intercepted-requests 0
allow-cgi-request-crunching 0
split-large-forms 0
keep-alive-timeout 5
socket-timeout 60
permit-access  192.168.100.0/24

forward-socks5 / 127.0.0.1:1080 .
forward         192.168.100.*/     .  
forward         192.168.*.*/     .  
forward         10.*.*.*/        .  
forward         127.*.*.*/       .
forward         .cn/            .
forward         .com.cn/            .




privoxy转发请求到ss的本地服务端口1080,同SS的配置文件,下面为白名单,这里的网站为直列连接方式,不走ss。具体见附件。


9. 启动ss 和privoxy
/etc/init.d/s-s start
/etc/init.d/privoxy start


10.将浏览器的HTTP代理设置为privoxy地址,192.168.100.1:8118.


11.如果你的路由器的WAN在某个局域网中,要为该WAN所在的局域网用户提供服务,需要修改路由器防火墙打开WAN端口,并且privoxy的config

增加一行:

listen-address和permit-access








本帖子中包含更多资源

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

×

评分

参与人数 1恩山币 +1 收起 理由
m*** + 1 呐,做人呢,最重要的就是开心

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
想要vps
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

本帖最后由 98118 于 2014-1-15 21:54 编辑

OP上的SS1.4.2能否绑定多个端口?
单个端口有大量数据传输时很容易被阻塞

楼上很熟口面啊

我的死活装不上??
root@Gargoyle:/tmp# opkg install shadowsocks-libev-polarssl_1.4.2-343940e6ffd206
2b11dccab0894b73f7f32722f7_ar71xx.ipk
gunzip: error inflating
gunzip: error inflating
ERROR: No package named shadowsocks-libev-polarssl found, try updating your pack
age lists


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

使用道具 举报

 楼主| | 显示全部楼层
98118 发表于 2014-1-15 21:50
OP上的SS1.4.2能否绑定多个端口?
单个端口有大量数据传输时很容易被阻塞

可以绑定多个端口,服务器端运行的时候指定配置文件和pid即可。不通配置文件中使用不通端口

客户端应该也是如此。

另,安装的时候你的命令行错了。

要么指定绝对路径如/tmp/ss.ipk,要么在/tmp下对当前路径加./

如 opkg install ./shadowsocks.ipk

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

使用道具 举报

pupie 发表于 2014-1-15 22:19
可以绑定多个端口,服务器端运行的时候指定配置文件和pid即可。不通配置文件中使用不通端口

客户端应 ...

还是不行
root@Gargoyle:~# opkg install /tmp/s
shadowsocks-libev-polarssl_1.4.2-343940e6ffd2062b11dccab0894b73f7f32722f7_ar71xx
.ipk
spool/
state/
sysinfo/
root@Gargoyle:~# opkg install /tmp/shadowsocks-libev-polarssl_1.4.2-343940e6ffd2
062b11dccab0894b73f7f32722f7_ar71xx.ipk
gunzip: error inflating
gunzip: error inflating
ERROR: No package named shadowsocks-libev-polarssl found, try updating your pack
age lists
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层

重新下载安装包,改个短点的名字重试
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

本帖最后由 98118 于 2014-1-16 09:47 编辑
pupie 发表于 2014-1-16 09:06
重新下载安装包,改个短点的名字重试
root@Gargoyle:/# ls -l /tmp/ |grep ss
-rw-r--r--    1 root     root         59395 Jan  5 09:54 ss.ipk
root@Gargoyle:/# opkg install /tmp/ss.ipk
gunzip: error inflating
gunzip: error inflating
ERROR: No package named shadowsocks-libev-polarssl found, try updating your pack
age lists


opkg也update一遍了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
忽略了一点,石像鬼固件不支持,openwrt目前作者也只支持trunk

要么自己编译一份
https://github.com/madeye/shadowsocks-libev

或者把ipk解压,里面有路径,该丢哪个目录丢哪
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

pupie 发表于 2014-1-16 11:47
忽略了一点,石像鬼固件不支持,openwrt目前作者也只支持trunk

要么自己编译一份

谢谢,我试试自己编译一个看看
是不是要在linux平台下使用gargoyle的源码才能编译ss?
ps:发现gargoyle发布了1.6.0 stable了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
98118 发表于 2014-1-16 12:45
谢谢,我试试自己编译一个看看
是不是要在linux平台下使用gargoyle的源码才能编译ss?
ps:发现gargoyle ...

是的,我在linux下编译的,需要openwrt编译环境,石像鬼我没用过,不知道其编译环境如何配置

刚才我在trunk下把github上最新源码编译了一份,基于openssl





本帖子中包含更多资源

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

×
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

pupie 发表于 2014-1-16 12:51
是的,我在linux下编译的,需要openwrt编译环境,石像鬼我没用过,不知道其编译环境如何配置

刚才我在 ...

可以给pogoplug编译一个吗?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

编译时,下载被墙,求破~
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

这个怎么做透明代理,实现局域网下的电脑免配置?
我的恩山、我的无线 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-27 09:36

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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

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