1, verify that the kernel is loaded with the MPPE module:
Modprobe ppp-compress-18 && echo MPPE is ok
2, the installation of the required software packages:
Yum-y Install PPP
wget ftp://rpmfind.net/linux/epel/7/x86_64/p/pptpd-1.4.0-2.el7.x86_64.rpm
RPM-IVH pptpd-1.4.0-2.el7.x86_64.rpm
3. Configure PPP and PPTP configuration files:
grep ^[^#]/etc/ppp/options.pptpd
Vi/etc/ppp/options.pptpd
Name pptpd
#refuse-pap
#refuse-chap
#refuse-mschap
require-mschap-v2
require-mppe-128
ms-dns 8.8.8.8
ms-dns 8.8.4.4
proxyarp
lock
nobsdcomp
novj Novjccomp Nologfd
Vi/etc/ppp/chap-secrets
Vi/etc/pptpd.conf
OPTION/ETC/PPP/OPTIONS.PPTPD
logwtmp
localip 192.168.0.1
remoteip 192.168.0.207-217
4, turn on the kernel IP forwarding function:
Vi/etc/sysctl.conf
/sbin/sysctl-p
5. Configure firewall and NAT forwarding
Yum Install iptables-services
systemctl stop firewalld.service
systemctl Disable Firewalld.service Systemctl Enable Iptables.service
systemctl start Iptables.service
To turn on packet forwarding:
Iptables-t nat-a postrouting-s 192.168.0.0/24-o eno16777736-j Masquerade
Service iptables save
Service Ipta Bles restart
Open port and GRE protocol:
Iptables-a input-p tcp-m State--state new,related,established-m TCP--dport 1723-j ACCEPT iptables-a
input-p g Re-m State--state new,related,established-j ACCEPT iptables-t nat-a postrouting-s 192.168.0.0/24-o eno16777736
-j Masquerade
To add a rule:
Iptables-a input-p gre-j ACCEPT
iptables-a input-p tcp-m tcp--dport 1723-j ACCEPT iptables-a input-m
STA Te--state related,established-j ACCEPT
iptables-a forward-s 192.168.0.0/24-o eno16777736-j ACCEPT
- A forward-d 192.168.0.0/24-i eno16777736-j ACCEPT iptables-t nat-a postrouting-s 192.168.0.0/24-o eno16777736
- J Masquerade
Service Iptables Save
To start and view services:
Systemctl start pptpd
systemctl enable pptpd
systemctl status pptpd
6. View PPTPD Service processes and ports:
#ps-ef | grep pptpd
Root 25100 1 0 14:19? 00:00:00/usr/sbin/pptpd-f
Root 25463 24275 0 14:52 pts/0 00:00:00 grep--color=auto pptpd
# netstat-n Utap | grep pptpd
TCP 0 0 0.0.0.0:1723 0.0.0.0:* LISTEN
The above is the small set for everyone to configure PPTP server configuration in Linux all content, I hope that we support cloud Habitat Community ~