配置环境:

linux server 132.232.36.126

Linux client 132.232.115.215

下载安装包:

pptp-1.7.2.tar.gz

解压安装包:

tar –zxvf pptp-1.7.2.tar.gz//

安装包:

  1. cd pptp-1.7.2.tar.gz
  2. linux-szdx:/ # More INSTALL
  3. linux-szdx:/ # Make
  4. linux-szdx:/ # Make install
  5. linux-szdx:/ # Cp /usr/share/doc/packages/ppp/scripts/pon /usr/sbin
  6. linux-szdx:/ # Cp /usr/share/doc/packages/ppp/scripts/poff /usr/sbin
  7. linux-szdx:/ # Chmod +x /usr/sbin/pon /usr/sbin/poff
  8. linux-szdx:/ # Vi etc/ppp/chap-secrets//编辑chap-secrets文件,输入vpn账户  
  9. (“用户名” “vpn” “密码”)
  10. linux-szdx:/ # Touch /etc/ppp/peers/vpn             //建立拨号连接vpn
  11. linux-szdx:/ # Vi /etc/ppp/peers/vpn                //编辑拨号vpn文件如下
  12. (pty “pptp 132.232.36.126 --nolaunchpppd”
  13. Name 用户名
  14. Remotenmae vpn
  15. File /etc/ppp/options.pptp
  16. Ipparam connect)
  17. linux-szdx:/ # Vi /etc/ppp/options.pptp //编辑options.pptp文件如下,注释#
  18. # options.pptp
  19. linux-szdx:/ # /usr/sbin/pon vpn &                             //拨号vpn
  20. linux-szdx:/ # Route add –host 132.232.36.126 gw 132.232.115.193  //配置路由指向
  21. linux-szdx:/ # Route del –net 0.0.0.0                           //删除默认路由
  22. linux-szdx:/ # Route add default ppp0                          //指向ppp0
  23. linux-szdx:/ # /usr/sbin/poff                                  //断开vpn