jimmyxu / chnroutes Goto Github PK
View Code? Open in Web Editor NEWForked from https://chnroutes.googlecode.com/
Home Page: https://chnroutes.googlecode.com/
Forked from https://chnroutes.googlecode.com/
Home Page: https://chnroutes.googlecode.com/
我想自己控制,哪些网址经过vpn,哪些网址不经过。
自己去控制这个需要vpn的网址的列表。。请问有没有这样的功能?
win10
执行vpnup.bat
提示:请求的操作需要提升?
请问怎么解决?
Cisco ipsec 无法使用
File "chnroutes.py", line 45
os.chmod('vpn-up.sh', 00755)
fedora 20没有/etc/ppp/ip-down.d文件夹 应该拷贝到哪儿才会自动执行呢
debian 7+python 2.7
python chnroutes.py -p linux
File "chnroutes.py", line 6
^
SyntaxError: invalid syntax
def generate_ddwrt(metric):
results = fetch_ip_data()
upscript_header = """\
#!/bin/sh
export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin"
OLDGW=$(nvram get wan_gateway)
if [ $OLDGW == '' ]
then
exit 1
fi
"""
downscript_header = """\
#!/bin/sh
export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/jffs/sbin:/jffs/bin:/jffs/usr/sbin:/jffs/usr/bin:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin"
"""
upfile = open('vpn-up.sh', 'w')
downfile = open('vpn-down.sh', 'w')
upfile.write(upscript_header)
downfile.write(downscript_header)
for ip, mask, _ in results:
upfile.write('route add -net %s netmask %s gw $OLDGW metric %d\n' % (ip, mask, metric))
downfile.write('route del -net %s netmask %s metric %d\n' % (ip, mask, metric))
upfile.write('\n')
downfile.write('\n')
upfile.close()
downfile.close()
os.chmod('vpn-up.sh', 00755)
os.chmod('vpn-down.sh', 00755)
我在Win10下输入命令:
C:>python chnroutes.py -p win
File "chnroutes.py", line 5
^
SyntaxError: invalid syntax
出现上面的错误,是什么原因呢?
没头绪啊
如题,
os x 10.9.2
使用chnroutes修改路由后某些国内IP的网站不能访问,比如百度,百度知道等等。
MYMAC:~ XXX$ route get zhidao.baidu.com
route to: 180.76.2.36
destination: 180.76.2.36
gateway: 192.168.0.1
interface: en0
flags: <UP,GATEWAY,HOST,DONE,WASCLONED,IFSCOPE,IFREF>
recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
0 0 0 0 0 0 1500 0
MYMAC:~ XXX$ route get baidu.com
route to: 220.181.111.85
destination: 0.0.160.220.broad.fz.fj.dynamic.163data.com.cn
mask: 255.224.0.0
gateway: 192.168.0.1
interface: en0
flags: <UP,GATEWAY,DONE,STATIC,PRCLONING>
recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
0 0 0 0 0 0 1500 0
mac下只搜到了iproute2mac……
而且安装了iproute2mac,在etc下也找不到openvpn
chnroutes-master>python chnroutes.py -p win
File "chnroutes.py", line 42
os.chmod('vpn-up.sh', 00755)
^
SyntaxError: invalid token
操作路由表需要root权限,需要配合busybox使用。
routes-up.sh脚本前若干行调整为:
alias nestat='/data/data/burrows.apps.busybox/app_busybox/netstat'
alias grep='/data/data/burrows.apps.busybox/app_busybox/grep'
alias awk='/data/data/burrows.apps.busybox/app_busybox/awk'
alias route='/data/data/burrows.apps.busybox/app_busybox/route'
gateway=route -n | awk '{print $1}'
gateway=$(echo $gateway | awk -F " " '{print $3}')
后边保持不变,祝好运!
请问ikev2协议可以支持吗
如题
When running the script when env python
returns to Python 3.2.3, a syntax error will occured:
File "chnroutes-jimmy.py", line 45 os.chmod('vpn-up.sh', 00755) ^ SyntaxError: invalid token
Either change env python
to env python2
or run the script with python2 chnroutes.py
will be a workaround.
Suggesting change the code to meet the syntax of Python 3.
配置好后,访问http://www.ip138.com/是国内的ip, 访问http://whatismyipaddress.com/是国外的ip,说明配置成功了。但是打开baidu.com qq.com sina.com 好多中文网站,使用的仍然是国外的ip。 好像没什么作用啊,常用 的网站用的还是VPN,这和没分流有区别?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.