首先,我们必须要知道自己的VPS是否支持PPTP.
1 2 3 4
| cat /dev/ppp cat: /dev/ppp: No such device or address cat /dev/net/tun cat: /dev/net/tun: File descriptor in bad state
|
我记得有一篇如果你的结果和我上面的两个结果不一样的话,那么你是肯定无法正常使用PPTP的哦. 不一样的话也好办,直接去tk VPS客服基本都会给开通的,我的VPN假架设在VPSYOU的openvz上,我联系客服10分钟后开通,赞一个先. 如果你的结果和我一样的话,那么就继续往下看吧.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| yum install -y ppp yum install -y iptables rpm -ivh http://acelnmp.googlecode.com/files/pptpd-1.3.4-1.rhel5.1.i386.rpm(X86) rpm -ivh http://acelnmp.googlecode.com/files/pptpd-1.3.4-1.rhel5.1.x86_64.rpm(X64) # 其他版本ppp 和 pptpd http://poptop.sourceforge.net/yum/stable/packages/ vi /etc/pptpd.conf # localip 192.168.0.1 -> localip 192.168.0.1 # remoteip 192.168.0.234-238,192.168.0.245 ->remoteip 192.168.0.234-238,192.168.0.245 vi /etc/ppp/options.pptpd # ms-dns 192.168.0.1 -> ms-dns 8.8.8.8 # ms-dns 192.168.0.2 -> ms-dns 8.8.4.4 require-mppe-128 -> # require-mppe-128 vi /etc/ppp/chap-secrets 用户名 pptpd 密码 * vi /etc/sysctl.conf net.ipv4.ip_forward = 0 -> net.ipv4.ip_forward = 1 net.ipv4.tcp_syncookies = 1 -> # net.ipv4.tcp_syncookies = 1 sysctl -p iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j SNAT --to-source 你的VPS的IP /etc/init.d/iptables save chkconfig pptpd on chkconfig iptables on /etc/init.d/pptpd restart /etc/init.d/iptables restart
|
现在你已经可以使用PPTP了,如果你连接的时候出现619错误的话.
1 2
| rm -r /dev/ppp mknod /dev/ppp c 108 0
|