Board logo

標題: 【OpenWRT PPTP VPN Server】——用TP-LINK TL-WR1043ND做例子 [打印本頁]

作者: 角色    時間: 2012-11-18 18:50     標題: 【OpenWRT PPTP VPN Server】——用TP-LINK TL-WR1043ND做例子

本帖最後由 角色 於 2012-11-18 18:54 編輯

在VPN研究室,已经有了很多VPN的帖子,但是比较乱,现在把最基本的先理顺好在继续。现在我用TP-LINK TL-WR1043ND (简单为1043ND)做例子,因为有性价比比较高,还有USB 2.0接口。

基本部署:

怎样实现有OpenWRT router
1. 买回来的1043ND,怎样mod成OpenWRT?
2. 在mod机要注意的地方。
3. 在mod过程中出现问题怎样处理

有了OpenWRT router
1. 先理顺怎样安装PPTP VPN Server
2. 然后再PPTP VPN Client
作者: 角色    時間: 2012-11-18 18:50

本帖最後由 角色 於 2012-11-18 19:08 編輯

怎样把新买回来的1043ND,正确mod成OpenWRT呢?

1. 现在在脑场买回来的1043ND, firmware已经有所更改,WAN port在bootloader已经disabled,你要按照这条Link去mod机就可以。

2. 如果在mod机过程发生意外,你的1043ND被你bricked了,你可以按照旁边的信息去un-brick它。Link
作者: 角色    時間: 2012-11-18 18:50

本帖最後由 角色 於 2012-11-18 19:18 編輯

在OpenWRT做PPTP VPN Server里有一下途径:

途径一:Command Line Interface (CLI)
1. 先用opkg安装所需要的packages
2. 用commands去安装PPTP VPN Server

途径二:用CLI and GUI
1. 先用opkg安装所需要的packages
2. 用commands和GUI去安装PPTP VPN Server

事前已经用上面两种方法去安装过,两种都能成功,但是事后觉得都是用第一种方法比较好,因为我可以从中学了很多的东西,就如我学习Asterisk Server一样,都是从CLI开始,然后装到GUI。
作者: 角色    時間: 2012-11-18 18:51

本帖最後由 角色 於 2013-11-17 22:03 編輯

在网上开到CHing 321在友台发表的论文(Link),真的不错,我用了来参考。

1. 先来安装pptpd,kmod-mppe packages和启动pptpd
  1. opkg update
  2. opkg install pptpd
  3. opkg install kmod-mppe
  4. /etc/init.d/pptpd enable
  5. /etc/init.d/pptpd start
複製代碼
2. Configure pptpd

用 vi 去edit /etc/pptpd.conf
  1. vi /etc/pptpd.conf
複製代碼
copy下面信息到上面的pptpd.conf
  1. #debug
  2. option /etc/ppp/options.pptpd
  3. localip 192.168.1.1
  4. remoteip 192.168.1.2-99
  5. speed 1152000
  6. stimeout 10
  7. #localip & remoteip are not needed, ip management is done by pppd
複製代碼
3. vi /etc/ppp/options.pptpd

把下面的信息加入/etc/ppp/options.pptpd
  1. #debug
  2. #logfile /tmp/pptp-server.log
  3. 192.168.1.1:
  4. auth
  5. name "pptp-server"
  6. lcp-echo-failure 3
  7. lcp-echo-interval 60
  8. default-asyncmap
  9. mtu 1482
  10. mru 1482
  11. nobsdcomp
  12. nodeflate
  13. #noproxyarp
  14. #nomppc
  15. chapms-strip-domain
  16. # Otherwise, your chap-secret file will have to include "DOMAIN\\user" instead of user.
  17. mppe required,no40,no56,stateless
  18. require-mschap-v2
  19. refuse-chap
  20. refuse-mschap
  21. refuse-eap
  22. refuse-pap
  23. ms-dns 192.168.1.1
  24. #plugin radius.so
  25. #radius-config-file /etc/radius.conf
複製代碼
4. 设PPTP client login name and password (/etc/ppp/chap-secrets)

Format: username空格*空格password空格*

vi /etc/ppp/chap-secrets
  1. #username * password *
  2. john * john-password *
  3. mary * mary-password *
複製代碼
5. Router firewall settings (/etc/firewall.user)

vi /etc/firewall.user
  1. iptables -A input_wan -p tcp --dport 1723 -j ACCEPT
  2. iptables -A input_wan -p gre -j ACCEPT
  3. iptables -A input_rule -i ppp+ -j ACCEPT
  4. iptables -A forwarding_rule -i ppp+ -j ACCEPT
  5. iptables -A forwarding_rule -o ppp+ -j ACCEPT
  6. iptables -A output_rule -o ppp+ -j ACCEPT
複製代碼
6. Reboot router

如果想进一步了解OpenWRT PPTP VPN Server,可以参考以下文献:

http://wiki.openwrt.org/doc/howto/vpn.server.pptpd
作者: 角色    時間: 2012-11-18 18:53

备用帖子
作者: 角色    時間: 2012-11-18 18:53

备用帖子
作者: 角色    時間: 2012-11-18 18:54

备用帖子
作者: 角色    時間: 2012-11-18 18:55

备用帖子
作者: 角色    時間: 2012-11-18 18:55

备用帖子
作者: 角色    時間: 2012-11-18 18:55

备用帖子
作者: 角色    時間: 2012-11-18 18:55

备用帖子
作者: 角色    時間: 2012-11-18 18:56

备用帖子
作者: 角色    時間: 2012-11-18 18:56

备用帖子
作者: 角色    時間: 2012-11-18 18:56

备用帖子
作者: 角色    時間: 2012-11-18 18:56

备用帖子
作者: 角色    時間: 2012-11-18 18:58

备用帖子
作者: winuall    時間: 2012-12-4 00:23

第二步己經止步
root@Gargoyle:~# opkg install pptpd
Installing pptpd (1.3.4-2) to root...
Downloading http://downloads.openwrt.org/att ... 1.3.4-2_ar71xx.ipk.
Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for pptpd:
*      kernel (= 3.3.8-1-54676ff21e7e4e275e485bc50fb94fcb) *   kernel (= 3.3.8-1-54676ff21e7e4e275e485bc50fb94fcb) *
* opkg_install_cmd: Cannot install package pptpd.
作者: 角色    時間: 2012-12-4 08:59

我不知道OpenWRT与Gargoyel的东西是否可以共用。
作者: dreamy2k    時間: 2012-12-4 10:28

本帖最後由 dreamy2k 於 2012-12-4 10:33 編輯
第二步己經止步
root@Gargoyle:~# opkg install pptpd
Installing pptpd (1.3.4-2) to root...
Downloadi ...
winuall 發表於 2012-12-4 00:23


最好先行
1. opkg update
2. opkg upgrade
3. opkg install kmod-mppe
4. opkg install pptpd
作者: winuall    時間: 2012-12-4 15:41

回復 19# dreamy2k

行第三步再行二? 但跳行第三步/etc/init.d/pptpd enable
-ash: /etc/init.d/pptpd: not found

肴個CHING 話行opkg upgrade, 就出現

root@Gargoyle:~# opkg upgrade
opkg: the ``upgrade'' command requires at least one argument
usage: opkg [options...] sub-command [arguments...]
where sub-command is one of:

如果行opkg install kmod-mppe
root@Gargoyle:~# opkg install kmod-mppe
Installing kmod-mppe (3.3.8-1) to root...
Downloading http://downloads.openwrt.org/att ... 3.3.8-1_ar71xx.ipk.
Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-mppe:
*      kernel (= 3.3.8-1-54676ff21e7e4e275e485bc50fb94fcb) *   kernel (= 3.3.8-1-54676ff21e7e4e275e485bc50fb94fcb) *   kernel (= 3.3.8-1-54676ff21e7e4e275e485bc50fb94fcb) *   kernel (= 3.3.8-1-54676ff21e7e4e275e485bc50fb94fcb) *   kernel (= 3.3.8-1-54676ff21e7e4e275e485bc50fb94fcb) *
* opkg_install_cmd: Cannot install package kmod-mppe.

總之就係唔得
作者: dreamy2k    時間: 2012-12-4 16:44

回復  dreamy2k

行第三步再行二? 但跳行第三步/etc/init.d/pptpd enable
-ash: /etc/init.d/pptpd: not f ...
winuall 發表於 2012-12-4 15:41


你個OPENWRT乜版本呀?系吾系最新的???如果吾系更新就去OPENWRT.ORG下載返個最新

因为OPENWRT OPKG時去找最新的package比你用但系你OPENWRT又吾"十卜"所以就出了呢個問題
作者: winuall    時間: 2012-12-4 17:25

回復 21# dreamy2k
跟升級指示係官網下載的, http://www.gargoyle-router.com/download.php
gargoyle_1.5.8-ar71xx-generic-tl-wr1043nd-v1-squashfs-factory
作者: dreamy2k    時間: 2012-12-4 21:49

回復  dreamy2k
跟升級指示係官網下載的,
gargoyle_1.5.8-ar71xx-generic-tl-wr1043nd-v1-squashfs-facto ...
winuall 發表於 2012-12-4 17:25


我以為你是用www.openwrt.org的官方版!!你用的版本我没用過呢...............
作者: 角色    時間: 2012-12-6 23:18

回復 20# winuall

是否可以看看OpenWRT firmware能否帮到你setup到VPN Server呢?
作者: Skypeus    時間: 2012-12-11 21:40

Multiple packages (kmod-ppp and kmod-ppp) providing same name marked HOLD or PREFER. Using latest.
Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for pptpd:
*         kernel (= 3.6.8-1-b22ecb1214fc38c754cb8110b4383804) *         kernel (= 3.6.8-1-b22ecb1214fc38c754cb8110b4383804) *
* opkg_install_cmd: Cannot install package pptpd.
安装时出现以上错误 , 这个怎么解决呢?
作者: Skypeus    時間: 2012-12-11 21:42

第二步己經止步
root@Gargoyle:~# opkg install pptpd
Installing pptpd (1.3.4-2) to root...
Downloadi ...
winuall 發表於 2012-12-4 00:23



    我安装时同样出现类似的错误 . 不知怎么解决这个错误,两个软件包无法安装到。
作者: 角色    時間: 2012-12-11 22:20

这里说用OpenWRT,而不是Gargoyle。
作者: Skypeus    時間: 2012-12-11 22:26

这里说用OpenWRT,而不是Gargoyle。
角色 發表於 2012-12-11 22:20



   我就是在OpenWRT环境下安装的,安装不了那两个软件包。
作者: Skypeus    時間: 2012-12-14 17:25

在OpenWRT里,还是没能装上 PPTP VPN Server   几时有解啊? 高手指点一下吧。
作者: 角色    時間: 2012-12-15 09:46

不会!找按照说明白安装,是没有问题的。
作者: Skypeus    時間: 2012-12-16 08:30

不会!找按照说明白安装,是没有问题的。
角色 發表於 2012-12-15 09:46



    按照你的方法一步步来安装PPTP还是会出现以上的错误。无法安装成功。重刷了openwrt或gargoyle后安装PPTP也是一样出错。




歡迎光臨 電訊茶室 (http://www.telecom-cafe.com/forum/) Powered by Discuz! 7.2