-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This modification is to support three or more gateways #14
base: master
Are you sure you want to change the base?
Conversation
Thanks for your contribution. I'll review the code soon (but very unlikely before Oct 1st.) |
https://gist.github.com/wen-long/8644243 |
大致看了一下用自定义 formatter 应该是可以的
|
#!/bin/sh
./generate.sh route.sh \
--net=cn,hk,kr,gb,de,it,0.0.0.0/0, \
--vpn=us,ie \
--nodefaultgw=1 \
--profile=custom \
--header="#!/bin/sh
iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个
iptables -t nat -A SHADOWSOCKS -d 123.456.789.111 -j RETURN
# 123.456.789.111 是 ss 代理服务器的 ip, 如果你只有一个 ss服务器的 ip,却能选择不同端口,就设置此条
iptables -t nat -A SHADOWSOCKS -d 0.0.0.0/8 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 10.0.0.0/8 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 127.0.0.0/8 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 169.254.0.0/16 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 172.16.0.0/12 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 192.168.0.0/16 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 224.0.0.0/4 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 240.0.0.0/4 -j RETURN
iptables -t nat -A SHADOWSOCKS -p tcp -j REDIRECT --to-ports 7777
# 7777 是 ss-redir 的监听端口,ss-local 和 ss-redir 的监听端口不同,配置文件不同
iptables -t nat -I PREROUTING -p tcp -j SHADOWSOCKS
# 在 PREROUTING 链前插入 SHADOWSOCKS 链,使其生效" \
--format="iptables -t nat -A SHADOWSOCKS -d %prefix/%length -j %gw" \
--netgw=RETURN \
--vpngw=ACCEPT
大概可以用 On Thu, May 22, 2014 at 11:27 AM, 石骁毅 [email protected] wrote:
|
--vpngw=ACCEPT表示应该通过vpn代理的,结果直接放行了。不是应该redirect吗?我试着把这些redirect。但不工作。 |
对于iptables可能需要将规则倒置才能实现,如果iptables是顺序匹配规则的话就需要这样做了 On Wednesday, January 7, 2015, momaer [email protected] wrote:
Sent from Gmail Mobile |
No description provided.