Board logo

標題: 【OpenWRT】——PPTP Server [打印本頁]

作者: 角色    時間: 2013-3-31 19:11     標題: 【OpenWRT】——PPTP Server

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

1. Using putty to enable the OpenWRT system. The default router IP is "192.168.1.1".
  1. login as: root
  2. root@192.168.1.1's password:


  3. BusyBox v1.19.4 (2013-03-14 11:28:31 UTC) built-in shell (ash)
  4. Enter 'help' for a list of built-in commands.

  5.   _______                     ________        __
  6. |       |.-----.-----.-----.|  |  |  |.----.|  |_
  7. |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
  8. |_______||   __|_____|__|__||________||__|  |____|
  9.           |__| W I R E L E S S   F R E E D O M
  10. -----------------------------------------------------
  11. ATTITUDE ADJUSTMENT (12.09, r36088)
  12. -----------------------------------------------------
  13.   * 1/4 oz Vodka      Pour all ingredients into mixing
  14.   * 1/4 oz Gin        tin with ice, strain into glass.
  15.   * 1/4 oz Amaretto
  16.   * 1/4 oz Triple sec
  17.   * 1/4 oz Peach schnapps
  18.   * 1/4 oz Sour mix
  19.   * 1 splash Cranberry juice
  20. -----------------------------------------------------
  21. root@OpenWrt:~#
複製代碼
2. Run the following commands
  1. opkg update
  2. opkg install pptpd
  3. opkg install kmod-mppe
  4. /etc/init.d/pptpd enable
  5. /etc/init.d/pptpd start
複製代碼
3. vi /etc/pptpd.conf

The default content
  1. #debug
  2. option /etc/ppp/options.pptpd
  3. speed 115200
  4. stimeout 10
  5. #localip & remoteip are not needed, ip management is done by pppd
複製代碼
Add the scripts after the end of the above code
  1. #debug
  2. option /etc/ppp/options.pptpd
  3. speed 115200
  4. stimeout 10
  5. #localip & remoteip are not needed, ip management is done by pppd
  6. localip 192.168.1.1
  7. remoteip 192.168.1.2-99
複製代碼
4. vi /etc/ppp/options.pptpd. The default settings are
  1. #debug
  2. #logfile /tmp/pptp-server.log
  3. 172.16.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. mppe required,no40,no56,stateless
  16. require-mschap-v2
  17. refuse-chap
  18. refuse-mschap
  19. refuse-eap
  20. refuse-pap
  21. #ms-dns 172.16.1.1
  22. #plugin radius.so
  23. #radius-config-file /etc/radius.conf
複製代碼
Replace the IP "172.16.1.1" by "192.168.1.1", the above settings become
  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. mppe required,no40,no56,stateless
  16. require-mschap-v2
  17. refuse-chap
  18. refuse-mschap
  19. refuse-eap
  20. refuse-pap
  21. ms-dns 192.168.1.1
  22. #plugin radius.so
  23. #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 the router


2013-4-14
之前的成功例子:http://www.telecom-cafe.com/foru ... ight=openwrt%2Bpptp

【1】http://wiki.openwrt.org/doc/howto/vpn.server.pptpd
【2】http://www.openwrt.org.cn/bbs/fo ... thread&tid=1081
作者: 角色    時間: 2013-3-31 23:29

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

备用帖子
作者: 角色    時間: 2013-4-17 00:47

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

备用帖子




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