在OpenVZ VPS 环境下,Debian系统安装PPTP VPN 教程

火币

openvz vps 环境下,debian系统的PPTP VPN安装教程

首先要检测你的VPS是否开启了TUN和PPP,联系你的服务器提供商,直接询问。如果没有开启,可以要求他们开启。

自行检测的方法:

检测TUN

[notification type=”info”] cat /dev/net/tun[/notification]

返回:

cat: /dev/net/tun: File descriptor in bad state 说明正常

检测是支持PPP模块

[notification type=”info”] cat /dev/ppp[/notification]

返回:

cat: /dev/ppp: No such device or address 说明正常

1- 接下来去下载VPN(Debian专用)一键安装包

[notification type=”error”] wget http://www.hi-vps.com/shell/vpn_debian.sh

chmod a+x vpn_debian.sh[/notification]

2- 运行一键安装包

[notification type=”info”] ./vpn_debian.sh[/notification]

3- 会有如下三个选择:

1). 安装VPN服务

2). 修复VPN

3). 添加VPN用户

首先输入1,回车,VPS开始安装VPN服务.

4- 添加VPN用户

[notification type=”info”] ./vpn_debian.sh[/notification]

选择3,然后输入用户名和密码,OK

5- 修复VPN服务

如果VPN拨号发生错误,可以试着修复VPN,然后重启VPS

[notification type=”info”] ./vpn_debian.sh[/notification]

选择2,然后Reboot

[notification type=”info”] sudo /etc/init.d/pptpd restart[/notification]

6-  从debian6卸载openvpn (还没试验过)

[notification type=”info”] dpkg -r openvpn

dpkg -i openvpn[/notification]

7- 添加PPTP VPN用户

编辑/etc/ppp/chap-secrets 添加如下内容:

[notification type=”info”] vi /etc/ppp/chap-secrets[/notification]

[notification type=”error”] username pptpd password *[/notification]

其中username为你要添加的VPN帐号的用户名,password为你VPN帐号的密码。

如果不喜欢用编辑器可以直接执行下面命令添加VPN帐号:

[notification type=”info”] echo “username pptpd password *”  >>/etc/ppp/chap-secrets[/notification]

在XP系统下建立VPN链接,使用你设置的用户名和密码登录,即可。如果出现714错误,在属性的安全选项卡里去掉加密勾选,应该就OK了!

 

这里是另外一种BuyVM OpenVZ VPS在Debian中按装PPTP VPN的方法,有些复杂我还没有实践过!

登陆SSH后

1.安装 pptpd

apt-get update apt-get install pptpd

2.配置 pptpd

修改 /etc/pptpd.conf 加入

localip 192.168.10.1 remoteip 192.168.10.234-238,192.168.10.245

(ip可以自定)
3.DNS

修改 /etc/ppp/options 加入

ms-dns 8.8.8.8 ms-dns 8.8.4.4

(dns可以自定)
4.开启ip转发

修改 /etc/sysctl.conf

net.ipv4.ip_forward=1

5.增加用户名密码

修改 /etc/ppp/chap-secrets 增加

username pptpd password *

(格式 user server password ip)
6.增加iptables转发规则

sudo /sbin/iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -j SNAT -–to-source “公网ip” sudo /sbin/iptables -A FORWARD -s 192.168.10.0/24 -p tcp -m tcp –tcp-flags FIN,SYN,RST,ACK SYN -j TCPMSS –set-mss 1356

7.重启 pptpd

sudo /etc/init.d/pptpd restart

8.如果出现619错误需

mknod /dev/ppp c 108 0

9.iptables规则需要保存到开机运行,否则重启后就不行了

vi /etc/pptpdfirewall.sh

加入:

sudo /sbin/iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -j SNAT -–to-source “你的IP” sudo /sbin/iptables -A FORWARD -s 192.168.10.0/24 -p tcp -m tcp –tcp-flags FIN,SYN,RST,ACK SYN -j TCPMSS –set-mss 1356

保存。

chmod 755 /etc/pptpdfirewall.sh vi /etc/init.d/rc.local

在最后一行加上

sh /etc/pptpdfirewall.sh

保存,完毕!另外,即便是用了pptpd,还需要将本地链接的DNS改为8.8.8.8 ,不然仍然访问不了twitter。

赞(0) 打赏
需要国外VPS建站朋友,请联系站长! 转载请注明文章来源:VPSMVP部落 - 便宜VPS|VPS优惠|VPS测评|美国VPS|VPS教程 » 在OpenVZ VPS 环境下,Debian系统安装PPTP VPN 教程
分享到: 更多 (0)
VULTR

相关推荐

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏




友情链接:
 |  赵容部落  |  老左笔记  |  微魔部落  |  便宜VPS  |  vps小学生  |  主机百科  |  老蒋部落  |  老刘博客  |  全球主机  |  全球主机交流  |  数字居民  |  LET论坛  |  veidc测评  |  挖站否  |  VPS收割者  |  主机贴士  |  惠主机  |  荒岛  |  VPS GO  |  国外VPS  |  主机之家测评

友情链接申请