一、简介
将DD-RWT路由器配置成v pn客户端实现访问facebook、youtube、twitter等网站自动**,访问国内网站不走v pn网络,节省流量并且速度快,通过路由器上网的设备(电脑、平板、手机、APPLE TV)不需要任务配置即可实现**g
注意:下面写些链接里有V pn字样的,使用时去掉空格,你懂得!
二、参考网站
本教程参考以下网站
DD-RWT 官方网址 http://www.ddwrt.com/wiki/index.php/%E5%AE%89%E8%A3%85
v pn 与 DNS 配置参考 https://code.google.com/p/autoddv pn/wiki/HOWTO
AUTODDv pn 配置参考 https://code.google.com/p/autoddv pn/wiki/jffs
三、SSH 配置
1、打开 SSH服务端
菜单 Services -> Services
操作 将SSHD 选中 Enable
配置好执行
1.Save (在浏览器最下端)
2.Apply Settings
2、打开 SSH 远程登陆
菜单 Administration ->
操作 将SSH Management 选中 Enable
四、DNS 配置
菜单 选择 setup -> Basic Setup
使用域名v pn的最好将dns配置 8.8.8.8 与 8.8.4.4 ,使用ip连接的可以跳过此步骤
五、v pn配置
菜单 Services -> v pn
操作 将PPTP Client Options 选中 Enable
v pn服务器地址可以填写域名,也可以填写IP地址,我用的是v pnpp ( 网址: gg8m.infogg8m.info、)
或者自己问度娘,说多了被人当广告
填写域名的话前面的dns一定要配置,否则会出现v pn无法连接
六、AUTODDv pn配置
Autoddv pn 配置可以在web界面下配置也可以通过SSH远程登陆配置
1.通过SSH远程登陆登陆,远程登陆参数如下
登陆地址:192.168.1.1
登陆账号:root
登陆密码:admin
以上参数均为默认参数,如果修改过请使用修改后的地址、账号与密码连接
(1)远程登陆后按顺序执行以下命令,最后一个命令为重启命令
nvram set jffs_mounted=1
nvram set enable_jffs2=1
nvram set sys_enable_jffs2=1
nvram set clean_jffs2=1
nvram set sys_clean_jffs2=1
nvram commit
Reboot
(2)放置腳本到jffs
重啟之後ssh進入ddwrt,切換到/jffs目錄,下載三個files:
$ mkdir /jffs/pptp
$ cd /jffs/pptp
$ wget http://autoddv pn.googlecode.com/svn/trunk/pptp/jffs/run.sh
$ for i in v pnup v pndown; do wget http://autoddv pn.googlecode.com/svn/trunk/$i.sh;done;
$ chmod a+x *.sh
這時記得ls -l /jffs/pptp/看一下是否檔案確實下載下來了,並且都是可執行的。
(3)rc_startup設置
最後設置rc_startup
$ nvram set rc_startup='/jffs/pptp/run.sh'
$ nvram commit
$ reboot
2.通过web界面配置
将以下几条命依次令放在 Administration -> Commands 执行
$ mkdir /jffs/pptp
$ cd /jffs/pptp
$ wget http://autoddv pn.googlecode.com/svn/trunk/pptp/jffs/run.sh
$ for i in v pnup v pndown; do wget http://autoddv pn.googlecode.com/svn/trunk/$i.sh;done;
$ chmod a+x *.sh
最后执行 ls /jffs/pptp 查看,如果有以下本个脚本则说明命令执行成功
run.sh
v pndown.sh
v pnup.sh
最后再执行以下三行命令完成配置
$ nvram set rc_startup='/jffs/pptp/run.sh'
$ nvram commit
$ reboot
七、检查
重開機之後檢查 autoddv pn.log
root@DD-WRT:/tmp# tail -f /tmp/autoddv pn.log
[INFO#324] 01/Jan/1970:00:00:16 log starts
[INFO#324] 01/Jan/1970:00:00:16 pptp+jffs mode
[INFO#324] 01/Jan/1970:00:00:16 modifying /tmp/pptpd_client/ip-up
[INFO#324] 01/Jan/1970:00:00:16 /tmp/pptpd_client/ip-up not exists, sleep 10sec.
[INFO#324] 07/May/2014:09:37:51 /tmp/pptpd_client/ip-up not exists, sleep 10sec.
[INFO#324] 07/May/2014:09:38:01 /tmp/pptpd_client/ip-up not exists, sleep 10sec.
[INFO#324] 07/May/2014:09:38:11 /tmp/pptpd_client/ip-up not exists, sleep 10sec.
[INFO#324] 07/May/2014:09:38:21 /tmp/pptpd_client/ip-up modified
[INFO#324] 07/May/2014:09:38:21 modifying /tmp/pptpd_client/ip-down
[INFO#324] 07/May/2014:09:38:21 /tmp/pptpd_client/ip-down modified
[INFO#324] 07/May/2014:09:38:21 ALL DONE. Let's wait for v pn being connected.
[INFO#816] 07/May/2014:09:38:31 v pnup.sh started
[INFO#816] 07/May/2014:09:38:31 router type: DD-WRT
[INFO#816] 07/May/2014:09:38:31 make 106.187.47.16 gw 192.168.2.1
[INFO#816] 07/May/2014:09:38:31 delete default gw 192.168.2.1
[INFO#816] 07/May/2014:09:38:31 add default gw 192.168.75.1
[INFO#816] 07/May/2014:09:38:31 adding the static routes, this may take a while.
[INFO#816] 07/May/2014:09:39:45 preparing the exceptional routes
[INFO#816] 07/May/2014:09:39:45 exceptional routes disabled.
[INFO#816] 07/May/2014:09:39:45 exceptional routes features detail: http://goo.gl/fYfJ
[INFO#816] 07/May/2014:09:39:46 v pnup.sh ended
[INFO#816] 07/May/2014:09:39:46 restarting DNS
root@DD-WRT:/tmp# route | tail -n 10
117.128.0.0 192.168.2.1 255.192.0.0 UG 0 0 0 vlan1
59.192.0.0 192.168.2.1 255.192.0.0 UG 0 0 0 vlan1
183.192.0.0 192.168.2.1 255.192.0.0 UG 0 0 0 vlan1
183.0.0.0 192.168.2.1 255.192.0.0 UG 0 0 0 vlan1
39.128.0.0 192.168.2.1 255.192.0.0 UG 0 0 0 vlan1
116.128.0.0 192.168.2.1 255.192.0.0 UG 0 0 0 vlan1
120.192.0.0 192.168.2.1 255.192.0.0 UG 0 0 0 vlan1
112.0.0.0 192.168.2.1 255.192.0.0 UG 0 0 0 vlan1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 192.168.75.1 0.0.0.0 UG 0 0 0 ppp0
注意最後default gateway就是v pn gateway
如果看到上面的日志,恭喜你成功了,接下来享受自由的网络吧^_^
目前市面上的v pn大部分都有流量限制,也有无限流量套餐,要保证流量够用 否则流量用完了,v pn就连接不上去了