pahud / autoddvpn

Automatically exported from code.google.com/p/autoddvpn
0 stars 0 forks source link

vpnup.sh与vpndown.sh的执行代码----反相了? #116

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
請描述一下您進行怎樣的操作之後碰到了問題
1.2012版的vpnup.sh与vpndown.sh的执行代码----反相了吗
2.本来可以直链的,全部跑去VPN了。
3.后面我加入直链的IP到vpnup.sh就发现,正常了没走VPN线路。

你期待是怎樣的結果,然而卻出現了什麼情形?

核实此问题

請提供以下資訊:

1. 您的路由器型號:贝尔金4301
2. DD-WRT版本:Tomato 版本 1.28.0905 MIPSR2-sady-0101 K26 USB 8M
3. 您的作業系統:LION,WIN7
4. 您的瀏覽器版本:IE8,SAFARI5.1.1
5. autoddvpn的連線模式(pptp+wget, pptp+jffs, 
openvpn+jffs等):openvpn+jffs
6. autoddvpn的運行模式,傳統模式(classicMode)還是優雅模式(g
raceMode):優雅模式
7. DD-WRT WAN口連線模式是 pptp or dhcp or static :dhcp
8. 運行autoddvpn之後DD-WRT 的命令輸出 # route -n  | tail -n 20 :
(以上1-8點必填,否則可能沒辦法即時協助你解決問題)

root@tomato:/tmp/home/root# route -n  | tail -n 20
112.224.0.0     192.168.2.1     255.224.0.0     UG    0      0        0 vlan2
111.128.0.0     192.168.2.1     255.224.0.0     UG    0      0        0 vlan2
110.96.0.0      192.168.2.1     255.224.0.0     UG    0      0        0 vlan2
36.96.0.0       192.168.2.1     255.224.0.0     UG    0      0        0 vlan2
110.192.0.0     192.168.2.1     255.224.0.0     UG    0      0        0 vlan2
36.192.0.0      192.168.2.1     255.224.0.0     UG    0      0        0 vlan2
39.64.0.0       192.168.2.1     255.224.0.0     UG    0      0        0 vlan2
117.128.0.0     192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
59.192.0.0      192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
183.192.0.0     192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
111.0.0.0       192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
183.0.0.0       192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
39.128.0.0      192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
120.192.0.0     192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
116.128.0.0     192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
223.64.0.0      192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
112.0.0.0       192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
36.128.0.0      192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         11.97.0.9       0.0.0.0         UG    0      0        0 tun11

如果方便的話,請參考這裡的說明,貼上autoddvpn.log內容
(說明:http://code.google.com/p/autoddvpn/wiki/DEBUG)

最後如果可能的話,請附上截屏或任何可能有幫助的夾檔

下载回来把vpnup,vpndown的命令为:
for i in vpnup vpndown; do wget 
http://autoddvpn.googlecode.com/svn/trunk/$i.sh;done;

并且把:vpnup.sh中的
“
                "openvpn")
                        OPENVPNSRV=$(nvram get openvpncl_remoteip)
                        OPENVPNDEV='tun0'

”
修改为了

“
                "openvpn")
                        OPENVPNSRV=$(nvram get openvpncl_remoteip)
                        OPENVPNDEV=$(ifconfig |grep tun | grep -Eo "tun([0-9.]+)" | cut -d: -f2)
”

就出现,apple服务器IP全部跑去VPN线路了。

例如此苹果服务器:203.69.113.128      203.69.113.136

修改苹果服务器地址是为了更快下载,而不用通过VPN的。

未加入203.69.113.136到vpnup.sh的状态:
traceroute to 203.69.113.136 (203.69.113.136), 64 hops max, 72 byte packets
 1  tomato (192.168.1.1)  0.978 ms  0.942 ms  1.070 ms
 2  11.97.0.1 (11.97.0.1)  270.433 ms  262.131 ms  245.732 ms    <----这是VPN 
 3  106.187.33.2 (106.187.33.2)  259.711 ms  248.212 ms  243.000 ms<------这是VPN
 4  124.215.199.121 (124.215.199.121)  253.331 ms  241.543 ms  254.726 ms
 5  59.128.4.121 (59.128.4.121)  242.940 ms  257.018 ms  257.574 ms
 6  tr-ote122.kddnet.ad.jp (59.128.7.150)  271.052 ms  273.383 ms  256.266 ms
 7  118.155.194.118 (118.155.194.118)  281.831 ms  281.590 ms  282.154 ms
 8  tpdt-4104.hinet.net (220.128.4.250)  282.542 ms  279.871 ms  274.703 ms
 9  tpdt-3011.hinet.net (220.128.3.126)  267.337 ms  278.089 ms  274.823 ms
10  tpdt-3301.hinet.net (220.128.3.137)  273.531 ms  280.517 ms  281.871 ms
11  203.69.113.136 (203.69.113.136)  274.910 ms  272.471 ms  277.383 ms

加入203.69.113.128 到vpnup.sh的状态:
traceroute to 203.69.113.128 (203.69.113.128), 64 hops max, 72 byte packets
 1  tomato (192.168.1.1)  63.832 ms  1.099 ms  1.056 ms
 2  tomato.tomato510v (192.168.2.1)  1.772 ms  1.533 ms  1.468 ms
 3  1.168.207.121.board.xm.fj.dynamic.163data.com.cn (121.207.168.1)  3.086 ms  2.568 ms  2.238 ms
 4  61.154.238.5 (61.154.238.5)  2.032 ms  1.840 ms  1.731 ms
 5  61.154.236.54 (61.154.236.54)  5.407 ms  5.164 ms  5.221 ms
 6  202.97.45.5 (202.97.45.5)  5.719 ms  5.854 ms  5.987 ms
 7  202.97.66.165 (202.97.66.165)  24.507 ms  24.375 ms  24.370 ms
 8  202.97.35.134 (202.97.35.134)  33.946 ms  35.148 ms  34.427 ms
 9  202.97.35.242 (202.97.35.242)  34.078 ms  34.839 ms  33.818 ms
10  202.97.60.78 (202.97.60.78)  34.692 ms  34.369 ms  34.112 ms
11  202.97.60.18 (202.97.60.18)  34.789 ms  40.251 ms  65.533 ms
12  202.97.6.30 (202.97.6.30)  55.438 ms  68.393 ms  55.113 ms
也检查过流量,的确没跑到VPN了。

请问有更好的解决方案吗?
谢谢。
祝春节愉快~

Original issue reported on code.google.com by linjimmyiphone@gmail.com on 21 Jan 2012 at 4:23

GoogleCodeExporter commented 9 years ago
root@tomato:/tmp/home/root# route -n  | tail -n 20
112.224.0.0     192.168.2.1     255.224.0.0     UG    0      0        0 vlan2
111.128.0.0     192.168.2.1     255.224.0.0     UG    0      0        0 vlan2
110.96.0.0      192.168.2.1     255.224.0.0     UG    0      0        0 vlan2
36.96.0.0       192.168.2.1     255.224.0.0     UG    0      0        0 vlan2
110.192.0.0     192.168.2.1     255.224.0.0     UG    0      0        0 vlan2
36.192.0.0      192.168.2.1     255.224.0.0     UG    0      0        0 vlan2
39.64.0.0       192.168.2.1     255.224.0.0     UG    0      0        0 vlan2
117.128.0.0     192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
59.192.0.0      192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
183.192.0.0     192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
111.0.0.0       192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
183.0.0.0       192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
39.128.0.0      192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
120.192.0.0     192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
116.128.0.0     192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
223.64.0.0      192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
112.0.0.0       192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
36.128.0.0      192.168.2.1     255.192.0.0     UG    0      0        0 vlan2
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         11.97.0.9       0.0.0.0         UG    0      0        0 tun11

從這最後一行看起來,你的router default gw是VPN 
gw了,這跟graceMode的機制是完全相反的,graceMode default gw是WAN 
gw, 其餘會再vpnup.sh裡面依序走vpngw

是不是你的openvpn有設置redirect-gateway等設置,強迫openvpn 
client全部流量走vpngw了?

我目前也是使用openvpn+jffs+graceMode on DDWRT,一切正常哦!

Original comment by pahud...@gmail.com on 21 Jan 2012 at 6:57

GoogleCodeExporter commented 9 years ago
另外如果你是用graceMode的話,你需要抓取的vpnup.sh在 
http://autoddvpn.googlecode.com/svn/trunk/grace.d/vpnup.sh

而不是

for i in vpnup vpndown; do wget 
http://autoddvpn.googlecode.com/svn/trunk/$i.sh;done;

再麻煩詳閱graceMode的文件吧
http://code.google.com/p/autoddvpn/wiki/graceMode

Original comment by pahud...@gmail.com on 21 Jan 2012 at 7:00

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
你好,感谢你的回复,已经根据你回复2修改好了,现在都正�
��分离国内走当地ISP,被墙自动走VPN了。

但是发现一个疑问
执行命令:traceroute 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 64 hops max, 52 byte packets

 1  tomato (192.168.1.1)  0.567 ms  0.528 ms  0.300 ms
 2  * * *
 3  * * *
 4  * * *
 5  * * *
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  202.39.235.195 (202.39.235.195)  402.838 ms  408.188 ms  407.939 ms

虽然都可以正常访问了(youtube.com视频也正常播放)

但是这个* 是咋回事了,我那里出错了?谢谢。
PS:任何被墙的站点都是这样的*,到最后一步骤会显示域名
指向的IP。

附
root@tomato:/tmp/home/root# route -n  | tail -n 20
64.237.47.0     11.97.0.9       255.255.255.0   UG    0      0        0 tun0
209.85.175.0    11.97.0.9       255.255.255.0   UG    0      0        0 tun0
75.101.159.0    11.97.0.9       255.255.255.0   UG    0      0        0 tun0
78.129.203.0    11.97.0.9       255.255.255.0   UG    0      0        0 tun0
209.133.27.0    11.97.0.9       255.255.255.0   UG    0      0        0 tun0
122.147.51.0    11.97.0.9       255.255.255.0   UG    0      0        0 tun0
66.102.0.0      11.97.0.9       255.255.240.0   UG    0      0        0 tun0
64.233.160.0    11.97.0.9       255.255.224.0   UG    0      0        0 tun0
208.117.224.0   11.97.0.9       255.255.224.0   UG    0      0        0 tun0
72.14.192.0     11.97.0.9       255.255.192.0   UG    0      0        0 tun0
66.220.0.0      11.97.0.9       255.255.0.0     UG    0      0        0 tun0
74.125.0.0      11.97.0.9       255.255.0.0     UG    0      0        0 tun0
116.214.0.0     11.97.0.9       255.255.0.0     UG    0      0        0 tun0
203.84.0.0      11.97.0.9       255.255.0.0     UG    0      0        0 tun0
184.72.0.0      11.97.0.9       255.255.0.0     UG    0      0        0 tun0
173.194.0.0     11.97.0.9       255.255.0.0     UG    0      0        0 tun0
69.171.0.0      11.97.0.9       255.255.0.0     UG    0      0        0 tun0
69.63.0.0       11.97.0.9       255.255.0.0     UG    0      0        0 tun0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         218.85.96.1     0.0.0.0         UG    0      0        0 ppp0

Original comment by linjimmyiphone@gmail.com on 22 Jan 2012 at 11:39

GoogleCodeExporter commented 9 years ago
能回答一下吗?谢谢

Original comment by linjimmyiphone@gmail.com on 24 Jan 2012 at 10:49

GoogleCodeExporter commented 9 years ago
*符號應該是沒問題的,可能表示traceroute過程有節點不回覆icm
p造成。

Original comment by pahud...@gmail.com on 24 Jan 2012 at 1:32