PPTP deployment in Linux Environment

I'm a rookie 131 2022-01-26 10:09:17 阅读数:455

pptp deployment linux environment

PPTP VPN(Windows Support )

problem

Building a pptp v_p_n Environmental Science , And test the v_p_n Whether the network can communicate normally , Requirements are as follows

  • Use pptp The protocol creates a tunnel connection that supports authentication
  • Use MPPE Encrypt data
  • Assign to clients 192.168.3.0/24 The address pool
  • The user name of the client connection is tom, The password for 123456

windows Virtual machines are used , The system used is Windows10 pro

programme :

The host required by the experimental environment and the corresponding ip The settings are shown in the table

Host name IP Address
Windows host 201.1.2.20
proxy eth0 192.168.19.130
eth3 201.1.2.5

Experimental Topology

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-eDz5Koxs-1632068774996)(E:/Typort/image-20210919213644901.png)]

step

Step one : To configure VPN The server

1) Install package

yum install ppp pptp net-tools iptables
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/ppp-devel-2.4.5-34.el7_7.x86_64.rpm
yum -y install ppp-devel-2.4.5-34.el7_7.x86_64.rpm
wget https://jaist.dl.sourceforge.net/project/poptop/pptpd/pptpd-1.4.0/pptpd-1.4.0.tar.gz
tar -xf pptpd-1.4.0.tar.gz
cd pptpd-1.4.0/
./configure
make &&make install
mkdir -p /usr/lib/pptpd/
ln -s /usr/local/pptpd/lib/pptpd/pptpd-logwtmp.so /usr/lib/pptpd/pptpd-logwtmp.so

2) Modify the configuration file

vim /etc/pptd.conf
localip 201.1.2.5 # Server local IP
remoteip 192.168.3.1-50 # Assigned to the client IP Address pool 
vim /etc/ppp/options.pptp
....
require-mppe-128 # Open notes , May be in 51 That's ok , You can also add 
ms-dns 8.8.8.8 # This line needs to add dns service 
vim /etc/ppp/chap-secrets
tom * 123456 *
# user name Server identity password client 
echo "1" > /proc/sys/net/ipv4/ip_forward # Turn on route forwarding 

3) Start the service

/usr/local/pptpd/sbin/pptpd -d -c /etc/pptpd.conf

4) open NAT

iptables -t nat -A POSTROUTING -s 192.168.3.0/24 -j SNAT --to-source 201.1.2.5
# To a private network IP Conversion bit public network IP
iptables -I INPUT -p tcp -m tcp --dport 1723 -j ACCEPT
1723 yes PPTP Default port

Step two : Client side Settings

1) Input V_P_N Server account and password , Connect v_p_n And test network connectivity

Click... In network settings v_p_n, And then add

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-KIdejHEu-1632068774997)(E:/Typort/image-20210919230627185.png)]

Enter the appropriate information

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-MUQe3rGL-1632068774998)(E:/Typort/image-20210919230532246.png)]

In the network card option , A new network card appears , Or in the connection pptpd The connection of , It indicates that the addition is successful

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-EDZQbBbi-1632068774998)(E:/Typort/image-20210919225411172.png)]

copyright:author[I'm a rookie 131],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/01/202201261009116385.html