PPTP environment deployment record under Centos

PPTP (Point-to-Point Tunneling Protocol) is a new technology used to allow remote users to dial-up to connect to a local ISP and securely access company resources remotely through the Internet. It can encapsulate PPP (Point-to-Point Protocol) frames into IP data packets so that they can be transmitted on the IP-based Internet. PPTP uses TCP (Transmission Control Protocol) connections to create, maintain, and terminate tunnels, and uses GRE (Generic Routing Encapsulation) to encapsulate PPP frames into tunnel data. The payload of the encapsulated PPP frame can be encrypted or compressed or both encrypted and compressed. Common PPTP is configured on the router, but the function of PPTP server can also be realized under linux. Let’s not talk about anything else, let’s directly record the V** environment process of deploying PPTP under Centos:

1 ) Verify PPP Use the cat command to check whether ppp is turned on. Generally, servers are turned on, except for special VPS hosts. [root@bastion-IDC ~]# cat /dev/ppp cat: /dev/ppp: No such device or address cat If the above result appears, it means that ppp is turned on, and pptp can be configured normally.

2 ) Install PPP [root@bastion-IDC ~]# yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers [root@bastion-IDCy-~]# install ppp iptables iptables is generally available after the system is installed by default. The installation of iptables is for NAT, so that PPTP clients can access the Internet through the PPTP server.

3 ) Install PPTP (here choose rpm package installation, you can also choose source package installation) Download address: https://pan.baidu.com/s/1dFIGpyx Extract password: cefm [root@bastion-IDC ~]# rpm -ivh pptpd-1.3.4-2. el6.x86_64.rpm

4 ) Configuration pptp /etc/pptpd.conf is the basic configuration file of pptpd; [root@bastion-IDC ~]# vim /etc/pptpd.conf ....... option /etc/ppp/options.pptpd // Specify the location of the pptpd extended attribute configuration file options.pptpd logwtmp debug //Enable debugging mode, information and errors related to pptpd will be recorded in /var/logs/message, which is convenient for troubleshooting and debugging stimeout 30 //Set the client connection pptpd The longest connection waiting time for server (connection timeout time), 30 seconds localip 192.168.1.5 //pptp server-side IP, which can be set to any IP address bound to the server (for example, set the intranet ip here) remoteip 192.168. 100.101-150 //The IP address range obtained by the client after successfully connecting to the V** (it can be in the same internal network segment as the pptp server, but it is recommended not to set the same network segment as the PPTP server internal network)

[ root@bastion-IDC ~]# vim /etc/ppp/options.pptpd ...... name pptpd //The name of the pptpd server (this is very important, it will be used in adding V** account configuration below) debug //Turn on the debugging mode, and related information is also recorded in /var/logs/message. ms-dns 8.8.8.8 //Modify to the dns address assigned by the V** user ms-dns 8.8.4.4

  1. Add V** account and password
[ root@bastion-IDC ~]# vim /etc/ppp/chap-secrets
# Secrets for authentication using CHAP
# client    server  secret          IP addresses
xqsj pptpd xqsj@123*

Explanation: Add an account in one line. The 4 fields that need to be added for each account are: username, service, password, and assigned ip address (if the IP is *, it means random assignment, and the range of assignment is in pptp.conf Settings)

6 ) Turn on the ip routing and forwarding function of the system [root@bastion-IDC ~]# echo 1> /proc/sys/net/ipv4/ip_forward //Turn it on temporarily, and it will become invalid after restarting the server [root@bastion-IDC ~]# vim / etc/sysctl.conf //Permanently open... net.ipv4.ip_forward = 1 [root@bastion-IDC ~]# sysctl -p

7 ) Start the service [root@bastion-IDC ~]# /etc/init.d/pptpd start Starting pptpd: [OK] [root@bastion-IDC ~]# lsof -i:1723 //The default port of the PPTP service is 1723 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME pptpd 19714 root 6u IPv4 33130051 0t0 TCP *: pptp (LISTEN)

Configure the service to start automatically after booting [root@bastion-IDC ~]# chkconfig pptpd on

8 ) Configure iptables forwarding [root@bastion-IDC ~]# iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -j SNAT --to-source 133.110.186.55 //Ensure that the client can connect to V** Normal Internet access [root@bastion-IDC ~]# iptables -t filter -A INPUT -p tcp -m state --state NEW -m tcp --dport 1723 -j ACCEPT [root@bastion-IDC ~]# /etc/ init.d/iptables save [root@bastion-IDC ~]# /etc/init.d/iptables restart The above command means: Let the ip address of the 192.168.100.0 segment (ie the remoteip address segment configured by pptpd.conf) pass The public IP 133.110.186.55 accesses the external network. Among them, 133.110.186.55 is the public IP address of the pptp deployment machine, otherwise the V** users who dialed up can only access the intranet. Open pptp service port 1723 access

9 ) Then you can create a new V** (encryption method is the default) connection on the client to test. (The following is the operation record under win10)

Check the ip information of the client after successful connection, whether it is normal to surf the Internet, etc.

Be sure to check the "Use the default gateway on the remote network" option to ensure that you can access the Internet normally after successfully connecting to the V**, and the exit ip is the external network ip of the PPTP server (and the firewall of the client is closed)

Recommended Posts

PPTP environment deployment record under Centos
FFmpeg environment deployment record under centos7
[CentOS environment deployment] Java7/Java8 deployment under CentOS
RabbitMQ cluster deployment record under Centos6.9
Elasticsearch cluster deployment record under CentOS7
SFTP dual-machine high availability environment deployment record under Centos
Complete deployment record for LDAP under Centos7.2
Django&MySQL environment deployment under Ubuntu 14.04
Build docker environment under Centos6.5
Centos7.2 deployment vnc service record
Erlang 20.2 installation and deployment under CentOS 7
MySQL 8.0 installation, deployment and configuration under CentOS 6/7
Centos-6.5 installation and deployment of LNMP environment
Zabbix installation and deployment and localization under CentOS
[PHP] Build a PHP operating environment under CentOS
Jenkins installation and deployment tutorial under CentOS 7
Python and scrapy deployment in centos environment
CentOS big data experiment environment change record
Some Centos Python production environment deployment commands
CentOS deployment Harbor
Build Discuz Forum in LNMP Environment under CentOS7
Notes on installing pptp server under CentOS 7 ok
Build LEMP (Linux+Nginx+MySQL+PHP) environment under CentOS 8.1 (detailed tutorial)
Build Dedecms website in LNMP environment under CentOS7
MySQL 8.0 installation and deployment under CentOS, super detailed!
Distributed deployment of Apollo configuration center under CentOS8
Deploy GitBook under CentOS7
Compile Hadoop-2.7.6 under CentOS7.4
CentOS6.7 build LNMP environment
Build a basic environment for Java development under Centos7
Install mysql5.7 under CentOS7
Hadoop environment construction (centos7)
CentOS server deployment (YUM)
Install ActiveMQ under Centos7
Centos7.6 build LNMP environment
lamp (centos7) installation lamp environment
Install PostgreSQL12 under CentOS7
Install CentOS under VMware
Centos6.9 install npm environment
Deploy JDK+Tomcat8 under CentOS
Configure lamp under centos6.8
Install Jenkins under Centos 7
Redis3 installation under Centos7
Install MariaDB under MariaDB Centos7
Centos7 configure nodejs environment
Environment configuration of JDK, mysql and tomcat under Centos7
ubuntu environment deployment project
Configure CentOS7 GPU environment
Rapid deployment of Kubernetes (k8s) cluster in CentOS7 environment
CentOS 7 build LNMP environment
CentOS7.6 server deployment VNC
Deployment of vulnerability scanning and analysis software Nessus under CentOS
Xen virtualization combat under CentOS 6.6
Centos 7 mini installation process record
Build OpenV** Server under CentOS7
CentOS 7 install JAVA environment (JDK 1.8)
Build OpenLDAP server under CentOS7
Install python environment under Linux
Redis cluster installation under CentOS
Centos7 set up GitBook environment
CentOS 7.2 deploy Node.js development environment