Build a VPN on CentOS

Source: Internet
Author: User

What is a VPN?


VPN is a virtual private network, its function is to establish a private network on the public network, to encrypt communications.

The VPN gateway enables remote access through the encryption of the packet and the conversion of the destination address of the packet. VPN has a variety of classification methods, mainly by protocol classification.

VPN can be implemented by server, hardware, software and many other ways. This article records the construction of the VPN server under the Linux system.




1. Check if you can access the extranet


Ping www.baidu.com




2. Installing the Dependency package PPP


Yum Install Ppp-y




3. Download and install the PPTPD package


wget ftp://mirror.switch.ch/pool/4/mirror/epel/6/x86_64/Packages/p/pptpd-1.4.0-3.el6.x86_64.rpm

If the RPM download link above is not available, visit the following URL to select an rpm download link:

Http://rpm.pbone.net/index.php3/stat/4/idpl/26021844/dir/redhat_el_6/com/pptpd-1.4.0-3.el6.x86_64.rpm.html





4. Modify the configuration file options.pptpd


Vim/etc/ppp/options.pptpd



Find the name option to dismiss the bank comment


Find the ms-dns option to dismiss the bank comment while modifying the DNS address




5. Modify the configuration file pptpd.conf


Vim/etc/pptpd.conf


Find PPP options and dismiss our comments


Find localip options and remoteip options


Among them, Localip 192.168.1.1 #取消这行注释, fill out the IP of the network, indicating the VPN login server address ;

Removeip 192.168.0.222-254 #取消这行注释, the IP pool assigned to the client when the VPN server is connected .






6. Modify the Chap-secrets configuration file to add VPN users


Vim/etc/ppp/chap-secrets


client indicates user name

Secret means password

IP Addresses indicates the IP address of the login (* represents unrestricted login IP)




7. Restart the service


/ETC/INIT.D/PPTPD restart




8. Turn off the firewall


Systemctl Stop firewalld.servicesystemctl Disable Firewalld.servicefirewall-cmd--state



9. Test connectivity


1) Go to Windows 10 settings and click "Network and Internet"



2) Click on VPN option and click "Add VPN Connection"


3) Enter the VPN login information


4) Successful Connection










Build a VPN on CentOS

Related Article

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.