1.查看系统是否支持ppp
一般自己的系统是支持的,VPS需要验证一下。
[[email protected] ~]# cat /dev/ppp cat: /dev/ppp: No such device or address
如果出现以上提示则说明ppp是开启的,可以正常架设pptp服务,若出现Permission denied等其他提示,你需要先去VPS面板里看看有没有enable ppp的功能开关,如果没有则需要发个消息给你的提供商,让他们帮你开通,否则就不必要看下去了,100%无法成功配置PPTP。
2.设置内核转发
[[email protected] ~]# grep forward /etc/sysctl.conf # Controls IP packet forwarding net.ipv4.ip_forward = 0 [[email protected] ~]# sed -i ‘s#net.ipv4.ip_forward = 0#net.ipv4.ip_forward = 1#g‘ /etc/sysctl.conf [[email protected] ~]# grep forward /etc/sysctl.conf # Controls IP packet forwarding net.ipv4.ip_forward = 1 #将net.ipv4.ip_forward = 0改为等于1
3.安装epel源
[[email protected] ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
4.安装PPTP
[[email protected] ~]# yum -y install pptpd
5.配置PPTP
[[email protected] ~]# cat >> /etc/pptpd.conf <<EOF localip 10.0.0.61 remoteip 172.16.1.234-238,172.16.1.245 EOF #添加本机公网IP地址(localip),分配vpn用户的内网网段(remoteip).
6.设置用户和密码
[[email protected] ~]# sed -i ‘2ioldboy * 123456 *‘ /etc/ppp/chap-secrets [[email protected] ~]# cat /etc/ppp/chap-secrets ####### system-config-network will overwrite this part!!! (begin) ########## oldboy * 123456 * ####### system-config-network will overwrite this part!!! (end) ############ #设置用户名为oldboy,密码为123456
7.启动PPTP
[[email protected] ~]# /etc/init.d/pptpd start Starting pptpd: [ OK ] [[email protected] ~]# netstat -lntup |grep 1723 tcp 0 0 0.0.0.0:1723 0.0.0.0:* LISTEN 22606/pptpd
8.通过Windows客户端连接VPN
时间: 2024-10-17 22:29:10