How to configure PPTP server configuration in Linux _linux

Source: Internet
Author: User
Tags iptables

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

Username  pptpd  passwd  *

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

Net.ipv4.ip_forward = 1

/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 ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.