架设好 shadowsocks 服务端,在路由器上安装 shadowsocks 客户端,并配置 /etc/config/shadowsocks.json ,假设本地监听端口为 1080 。启动 shadowsocks
/etc/init.d/shadowsocks start
安装 privoxy openwrt 版。
##ss-redir 的 iptables 配置(透明代理)
透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则
创建 /etc/ss-redir.json 本地监听 7777
运行ss-redir -v -c /etc/ss-redir.json
iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个
| #!/bin/bash | |
| # How to use | |
| # 1. Replace the "YOURIP" to yourIP | |
| #sed -i -e 's/YOURIP/192.168.x.x/g' setup-taiga-centos.sh | |
| # 2. Run at the root | |
| #source setup-taiga-centos.sh |
| frontend http | |
| bind 10.0.0.1:80 | |
| mode http | |
| # Add a new header with the environment variable and the path concatenated | |
| http-request set-header X-ROUTING %[env(SERVER_AUTH)]::%[path] | |
| # Then compare the value using a regular expression with back-references | |
| # We need to use a named capture because of "reasons". Backreferences to normal captures seem to be rejected by HAProxy | |
| use_backend app if { req.hdr(X-ROUTING) -m reg ^(?<auth>.+)==\1 } | |
| # Cleanup in case we hadn't matched yet |
| # This script create a Centos Minimal Unattended ISO | |
| # This method is based on excellent article http://pyxlmap.net/technology/software/linux/custom-centos-iso | |
| # | |
| # This script has be tested with CentOS 7.2 (on the orign server) to install CentOS 7.2 (on the target server) | |
| # TODO: | |
| # * test package update to reduce the update task on the target system. The following command downloads all updates : | |
| # (cd $CENTOS_CUSTOM_PATH/Packages ; yumdownloader $(for i in *; { echo ${i%%-[0-9]*}; } ) ) | |
| # Some global settings : |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |