1.环境检查
[root@pptp dev]# cat /dev/ppp
cat: /dev/ppp: 没有那个设备或地址
[root@pptp dev]# getenforce
Disabled
[root@pptp dev]# /etc/init.d/iptables status
iptables:未运行防火墙。
2.安装PPTP
2.1更改yum源
由于本身的yum源中没有PPTP包,所以需要更改yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
2.2下载PPTP
yum install -y pptpd
3.配置PPTP
sed -i.ori '$a localip 10.0.0.200\nremoteip 172.16.1.120-200' /etc/pptpd.conf
参数说明:
参数 | 说明 |
localip | PPTP服务器公网IP地址 |
remoteip | PPTP服务器分配给客户端连接的内网地址 |
3.1配置账号密码
echo "name * 123456 *" >>/etc/ppp/chap-secrets
设置说明:
内容 | 说明 |
name | 设置登录账户名字 |
第一个“*” | 对应VPN服务器的名字,可用*代替 |
123456 | 登录账户的密码 |
第二个“*” | 分配给客户的IP地址,可用“*”代替。 |
4.启动PPTP
通过连接工具另启窗口
tailf /var/log/messages
4.1启动PPTP
/etc/init.d/pptpd start
观察/var/log/messages
[root@pptp ~]# netstat -luntp|grep pptp
tcp 0 0 0.0.0.0:1723 0.0.0.0:* LISTEN 26490/pptpd
表示PPTP已经启动成功
客户端连接(Windows8)
5.解决连接断网问题
6.设置内核转发
vim /etc/sysctl.conf
net.ipv4.ip_forward = 1
sysctl -p