配置环境:
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//
安装包:
- cd pptp-1.7.2.tar.gz
- linux-szdx:/ # More INSTALL
- linux-szdx:/ # Make
- linux-szdx:/ # Make install
- linux-szdx:/ # Cp /usr/share/doc/packages/ppp/scripts/pon /usr/sbin
- linux-szdx:/ # Cp /usr/share/doc/packages/ppp/scripts/poff /usr/sbin
- linux-szdx:/ # Chmod +x /usr/sbin/pon /usr/sbin/poff
- linux-szdx:/ # Vi etc/ppp/chap-secrets//编辑chap-secrets文件,输入vpn账户
- (“用户名” “vpn” “密码”)
- linux-szdx:/ # Touch /etc/ppp/peers/vpn //建立拨号连接vpn
- linux-szdx:/ # Vi /etc/ppp/peers/vpn //编辑拨号vpn文件如下
- (pty “pptp 132.232.36.126 --nolaunchpppd”
- Name 用户名
- Remotenmae vpn
- File /etc/ppp/options.pptp
- Ipparam connect)
- linux-szdx:/ # Vi /etc/ppp/options.pptp //编辑options.pptp文件如下,注释#
- (# options.pptp)
- linux-szdx:/ # /usr/sbin/pon vpn & //拨号vpn
- linux-szdx:/ # Route add –host 132.232.36.126 gw 132.232.115.193 //配置路由指向
- linux-szdx:/ # Route del –net 0.0.0.0 //删除默认路由
- linux-szdx:/ # Route add default ppp0 //指向ppp0
- linux-szdx:/ # /usr/sbin/poff //断开vpn