harleylg / autoddvpn

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

default gw为空,无法建立vpn连接 #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. 您的路由器型號:LinkSys WRT54G2 v1
2. DD-WRT版本: DD-WRT v24-sp2 (07/22/09) mega
3. 您的作業系統:windows 2008 ent x64 / fedora 12 x64
4. 您的瀏覽器版本:chrome 4.1.249 / ie 8 / firefox 3.5

如果方便的話,請參考這裡的說明,貼上autoddvpn.log內容
(說明:http://code.google.com/p/autoddvpn/wiki/DEBUG)
--------
[DEBUG] failed to get PPTPDEV, retry in 3 seconds
[DEBUG] failed to get PPTPDEV, retry in 3 seconds
[DEBUG] failed to get PPTPDEV, retry in 3 seconds
[DEBUG] failed to get PPTPDEV, retry in 3 seconds
[DEBUG] failed to get PPTPDEV, retry in 3 seconds
[DEBUG] failed to get PPTPDEV, retry in 3 seconds
[DEBUG] failed to get PPTPDEV, retry in 3 seconds
[INFO] got PPTPDEV as ppp0, set into nvram
[INFO] got PPTPGW as 10.0.0.1 , set into nvram
[INFO] VPN is UP, trying to modify the routing table
[INFO] delete default gw 0.0.0.0
[INFO] add default gw 10.0.0.1 
[INFO] adding the static routes, this may teke a while.
[INFO] final check the default gw
[DEBUG] my current gw is 
[INFO] static routes added
[DEBUG] return 0
[DEBUG] break
--------
log如上,my current gw is 
为空,没有得到gateway,我不知道为什么会这样。不使
用ddwrt,直接在操作系统本身使用pptp连接可以连接上,在windo
ws下连接上以后查
看ipconfig以及tracert,应该gateway是10.0.0.1吧(见附件截图),��
�以我想我在
dd-wrt中设置的subnet和subnet 
mask应该没有问题啊,但不知道为什么总是不通,得
不到gw,望指点,非常感谢
--------------
express.myself@gmail.com

Original issue reported on code.google.com by express....@gmail.com on 31 May 2010 at 8:48

Attachments:

GoogleCodeExporter commented 9 years ago
不知道是不是说清楚了,上面那几张截图是在windows下连接vpn�
��有使用ddwrt的情况下的配置信
息。

Original comment by express....@gmail.com on 31 May 2010 at 9:19

GoogleCodeExporter commented 9 years ago
非常清楚了。我目前判斷是 router_dhcp.jpg  
這裡設定問題。請問一下:

1. 你的WAN是PPPoE嗎, 也就是一般的ADSL嗎
2. router_dhcp.jpg  這張圖裡面 Gateway 
192.168.1.1應該是不需要設置的

Original comment by pahud...@gmail.com on 31 May 2010 at 9:27

GoogleCodeExporter commented 9 years ago
感谢回答
1.这台ddwrt路由器是接在公司局域网内部的,分配的地址192.168
.1.2是公司内部局域网地址,
192.168.1.1这台是局域网的出口路由器.
2.我不知道不设置是不是可以,我一会儿试试.

下面附几张截图,关于这台翻墙路由器的lan和wan设置信息

Original comment by express....@gmail.com on 31 May 2010 at 9:38

Attachments:

GoogleCodeExporter commented 9 years ago
好像 router ip 那儿的 gateway 必须得设一个啊

Original comment by express....@gmail.com on 31 May 2010 at 9:41

GoogleCodeExporter commented 9 years ago
router_wan.jpg  這張圖設置錯誤了

如果公司網路是DHCP發放IP給你的話,例如發給你192.168.172.22 
甚至隨機發給你的話,

你設置router IP 192.168.1.2 netmask 255.255.255.0 即可, 
這裡完全不需要再設置Gateway了。

能否再描述一下你的公司DHCP發放的IP網段以及公司網關IP?

Original comment by pahud...@gmail.com on 31 May 2010 at 9:46

GoogleCodeExporter commented 9 years ago
没有启用dhcp, 公司网关是 192.168.1.1, 
局域网设置就是192.168.1.0/255.255.255.0 

Original comment by express....@gmail.com on 31 May 2010 at 9:51

GoogleCodeExporter commented 9 years ago
"你設置router IP 192.168.1.2 netmask 255.255.255.0 即可, 
這裡完全不需要再設置Gateway
了。"
---------
但是似乎那个文本输入框不能为空??? 
不需要设置,但是我也无法清除现有的设置啊

Original comment by express....@gmail.com on 31 May 2010 at 9:53

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
好的,所以你是使用static 
方式,這時候DD-WRT其實是在公司給你的IP下面另外再切出一個
subnet

這樣設定看看

WAN Connection Type: static IP 
然後會看到可以設置的部分, 這裡填寫公司的IP資訊,例如
IP: 192.168.1.2 (公司給你的IP)
mask: 255.255.255.0
GW: 192.168.1.1 (公司的GW)

然後設置你的router, 切出另一個subnet

router IP: 192.168.100.1
mask: 255.255.255.0
GW不需要設定

這時候DDWRT就會建立一個192.168.100.0/24的subnet,而這個subnet裡��
�的所有client就可以透過
DDWRT連出去。

你要的是這樣的結果嗎?

Original comment by pahud...@gmail.com on 31 May 2010 at 10:03

GoogleCodeExporter commented 9 years ago
嗯... 
实际上我可以自由使用公司的ip地址,不需要再另外切出subnet
,我设想的是现在局域网里
有两台路由器,一台是192.168.1.1,一台是192.168.1.2,普通工作�
��途的话将网关设为
192.168.1.1就行了,如果需要翻墙就将网关设置为192.168.1.2。不�
��道这样可否实现? 不过另开
subnet的想法也可以,我试试

Original comment by express....@gmail.com on 31 May 2010 at 10:06

GoogleCodeExporter commented 9 years ago
另外你说的gw不需要设定,我不知道如何不做任何设定,如果
删除文本框里的数字会跳出提示窗
口,必须要填写,那么应该怎么填,0.0.0.0吗?

Original comment by express....@gmail.com on 31 May 2010 at 10:10

GoogleCodeExporter commented 9 years ago
yes 0.0.0.0

你先試試看另開subnet吧

Original comment by pahud...@gmail.com on 31 May 2010 at 10:23

GoogleCodeExporter commented 9 years ago
>我设想的是现在局域网里有两台路由器,一台是192.168.1.1,��
�台是192.168.1.2,普通工作用途的话将网
关设为192.168.1.1就行了,如果需要翻墙就将网关设置为192.168.1
.2

這個架構不是不可能,但是需要花一些時間調整腳本,目前��
�部分用戶都不是這個scenario, 所以我就不打算調
整腳本了,再麻煩您試試看subnet的方式,並讓我知道是否成��
�,謝謝!

Original comment by pahud...@gmail.com on 31 May 2010 at 10:27

GoogleCodeExporter commented 9 years ago
嗯,刚试了,没有成功。wan设置见附图,pptp 
client也启用了,firewall也配置了,但是启用以后
执行cat /tmp/autoddvpn.log却没有任何输出,当然也就没有连上了

Original comment by express....@gmail.com on 31 May 2010 at 10:32

Attachments:

GoogleCodeExporter commented 9 years ago
你有辦法ssh進去ddwrt裡面,打一下which tee
我看一下是不是沒有tee這個指令?

目前我寫入log的方式是用tee命令,不過我這邊有一台是刷比��
�新的ddwrt版本,裡面沒有tee指令,
我正在開發一個新版的。

另外,如果你ssh進去成功之後,試著手動下rc_firewall的那一整
行命令,然後把畫面的輸出貼給我看一下,也許
我可以幫忙。

Original comment by pahud...@gmail.com on 31 May 2010 at 11:06

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
對了如果你能ssh進去,再幫忙測試一下幾個:

1. ping 192.168.1.1  確定你跟公司gw是通的
2. ping 你VPN的IP, 確定你可以出公司gw到VPN public IP
3. ifconfig ppp0 確定你的PPTP VPN有撥上。
這個如果沒有播上的話,你可以連續打,如果發現2-3min都沒��
�上,但是1~2的測試都是OK的話,那就是
PPTP無法連接的問題。

如果1-3都OK, 
那就手動執行那行rc_firewall命令,並且把輸出貼給我看看

Original comment by pahud...@gmail.com on 31 May 2010 at 11:09

GoogleCodeExporter commented 9 years ago
我這邊發現,如果WAN是static 
IP的話,網路一帶起來就直接執行wget可能會有問題,
我這邊調整一下腳本,應該等一下就可以釋放出一個測試版��
�了。

你這邊可以先ssh進去手動執行rc_firewall看看。

Original comment by pahud...@gmail.com on 31 May 2010 at 11:22

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
20100531的dev version我剛剛放出了,請幫忙測試看看
http://code.google.com/p/autoddvpn/wiki/DevVersion
目前發現DD-WRT的 WAN形態不能設置為static IP, 
否則可能PPTP無法撥號成功,這可能是ddwrt的bug

Original comment by pahud...@gmail.com on 31 May 2010 at 11:56

GoogleCodeExporter commented 9 years ago
新版應該已經解決了,見
http://code.google.com/p/autoddvpn/wiki/HOWTO

Original comment by pahud...@gmail.com on 22 Jun 2010 at 11:06