Linux环境部署PPTP

一、PPTP简介

PPTP:点对点隧道协议(Point to Point Tunneling Protocol)
点对点隧道协议(PPTP)是一种支持多协议虚拟专用网络的网络技术。是一种用于让远程用户拨号连接到本地的ISP,通过因特网安全远程访问公司资源的新型技术。它能将PPP(点到点协议)帧封装成IP数据包,以便能够在基于IP的互联网上进行传输。PPTP使用TCP(传输控制协议)连接的创建,维护,与终止隧道,并使用GRE(通用路由封装)将PPP帧封装成隧道数据。被封装后的PPP帧的有效载荷可以被加密或者压缩或者同时被加密与压缩。

二、环境准备

[root@pptp ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
[root@pptp ~]# setenforce 0
setenforce: SELinux is disabled
[root@pptp ~]# systemctl stop firewalld
[root@pptp ~]# systemctl disable firewalld

三、安装软件

[root@pptp ~]# yum install vim unzip lrzsz wget net-tools -y
[root@pptp ~]# yum install perl pptpd lsof -y

四、配置pptpd

[root@pptp ~]# mkdir /backup
[root@pptp ~]# cp /etc/pptpd.conf /backup/
[root@pptp ~]# vim /etc/pptpd.conf
localip 10.0.0.77
remoteip 172.16.1.10-100

五、配置options pptpd

[root@pptp ~]# cp /etc/ppp/options.pptpd /backup/
[root@pptp ~]# vim /etc/ppp/options.pptpd
ms-dns 8.8.8.8
ms-dns 114.114.114.114

六、配置账户密码

[root@pptp ~]# cp /etc/ppp/chap-secrets /backup/
[root@pptp ~]# vim /etc/ppp/chap-secrets
jzyue pptpd 123456

七、配置转发

[root@pptp ~]# vim /etc/sysctl.conf
et.ipv4.ip_forward=1
sysctl -p

八、启动pptp、开启NAT转发规则

[root@pptp ~]# systemctl start pptpd
[root@pptp ~]# iptables -t nat -A POSTROUTING -o eth0 -s 10.0.0.0/24 -j MASQUERADE
[root@pptp ~]# ss -lntup|grep 1723
tcp LISTEN 0 3 *:1723 : users:(("pptpd",pid=1965,fd=6))

九、本地电脑添加VPN

image.png

image.png

image.png

image.png

配置完成先不要连接,先对新建立的VPN隧道进行配置

image.png

image.png
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容