Install pptpd and vpn proxy on the VPS Server

Source: Internet
Author: User
Tags virtual private server vps server
A vps host (or VPS) is a virtual server that uses virtual server software to create multiple isolated small servers on a physical server, each VPS has its own operating system, independent space, independent memory, and independent CPU resources. It can independently execute programs and system configurations, its operation and management, and its independent servers.

Virtual Private Server (VPS) is used to create multiple isolated small servers on a physical Server, each VPS has its own operating system, independent space, independent memory, and independent CPU resources. It can independently execute programs and system configurations, its operation and management are exactly the same as those of an independent server. Currently, the network is quite popular and the most widely usedVirtualizationThere are two main technologies: Openvz and Xen. Today, we will introduce how to activate the VPN service for VPS based on these two virtual technologies.
1. Install pptpd vpn on VPS Based on Xen Virtual Technology:
Here we will introduce you to a one-click installation package that has been compiled: (it has been successfully compiled on EmsVps, siyue innovation, and 28Vps, and passed)
Applicable system: CentOS 5 32 bits/64 bits
Applicable host type: VPS or Linux Server Based on Xen Virtual Technology
One-click installation package: (directly copy the followingCommand, Run)
Installation command: wget http://down.vpsma.com/vpn/pptpd.sh;sh./pptpd. sh;
After the installation is successful, the vpn account and password are automatically generated as follows:
VPN service is installEd, Your VPN username is vpn, VPN password is xssww2w
Copy the vpn and password to enable the vpn connection on the computer!
How to change the vpn password or add a vpn account:
Edit the/etc/ppp/chap-secrets file and change it to your own format:
Edit the command: vi/etc/ppp/chap-secrets, enter the letter I, and change the user name and password according to the format. To add a user, you only need to add the user name and password in the next line according to the format.
Save settings: Enter CTrL + c: exit the editing status, Output C twice in a row (uppercase), and save the settings.
2. Install pptpd vpn on the VPS Based on Openvz Virtual Technology:
Applicable system: CentOS 5 32 bits/64 bits
Applicable host type: VPS or Linux Server Based on Openvz Virtual Technology
Because the VPS Based on Openvz virtual technology does not have a sit0 Nic, enabling pptpd vpn is slightly different from the VPS Based on Xen virtual technology.
This method has been successfully compiled on the famous brick host HostRail. By default, the HostRail VPS does not activate TUN-TAP. You need to issue a ticket request to activate it. The following describes how to activate it.
Installation Method:
1. First check whether TUN-TAP/PPP of your vps host is enabled
Cat/Dev/net/tun # directly output the command
If it is enabled, the output may be 5 rows. There are more than one type, for example, the following is normal.
Cat:/dev/net/tun: File descriptor in badStatE
If not enabled, the display permission is insufficient and denied. If not enabled, the display is as follows:
Cat:/dev/net/tun: PeRmIssion denied
Run the following command to view ppp Information:
Cat/dev/ppp # direct output command
The output below is OK!
Cat:/dev/ppp: NoSuCh device orDdRess
If it is not enabled, submit a ticket request to your host service provider to activate these two services, as shown below:
Hello
Cocould youEnableD TUN-TAP and PPP for me? I want run pptp-vpn on my VPS.
Thank you.
After the installation is enabled, confirm that you can start the installation.
2. upgrade the system package
Yum upDate-Y # directly output the command
3. Check whether ppp iptables is installed. If no ppp iptables is installed, install it. (CentOS is installed by default and the firewall is enabled. You do not need to execute the 2nd-line firewall !)
Yum install-y ppp
Yum install-y iptables
When ppp is installed on hostrail, installation Errors often occur due to insufficient memory. In this case, we can use the following command for installation.
Yum-disableplugin = fastestmirror install ppp
4. Install pptpd
The following installation package is recommended. Copy and run the installation package directly.
Rpm-ivh http://poptop.sourceforge.net/yu... 4-2.rhel5.i386.rpm
5. Configure pptp
First, edit the/etc/pptpd. conf file:
Vim/etc/pptpd. conf
Remove the # preceding the following field:
Localip 192.168.0.1
Remoteip 192.168.0.234-238,192.168 .0.245
Next, edit/etc/ppp/options.ppt pd:
Vim/etc/ppp/options.ppt pd
Remove "#" before "ms-dns" and modify it to the following fields:
Ms-dns 8.8.8.8
Ms-dns 8.8.4.4
It is important to find the require-mppe-128 line plus # in front.
6. Set a VPN account
Edit the/etc/ppp/chap-secrets file:
Vim/etc/ppp/chap-secrets
Enter the following username and password fields:
Username pptpd password *
7. Modify kernel settings and support forwarding
Edit the/etc/sysctl. conf file:
Vim/etc/sysctl. conf
Change "net. ipv4.ip _ forward" to 1:
Net. ipv4.ip _ forward = 1
At the same timeCp_ SyNcOokies = 1 "plus #:
# Net. ipv4.tcp _SyncOokies = 1
Save and exit, and execute the following command to take effect:
Sysctl-p
8. Add iptables firewall Forwarding (two half-width minus signs before to-source !)
Iptables-t nat-a postrouting-s 192.168.0.0/16-j SNAT-to-source your VPS Host ip
Save iptables forwarding rules:
/Etc/init. d/iptables save
Restart iptables:
/Etc/init. d/iptables restart
9. Restart pptp and set auto-start
/Etc/init. d/pptpd start
ChkconfigPptpd on
Chkconfig iptables on
10. Select none or no encryption for client data encryption. Try either of them.
11. Solve the 619 error as follows:
(1) If the execution of cat/dev/ppp does not exist, execute the following command; otherwise, do not execute
Rm-r/dev/ppp
(2) Execution
Mknod/dev/ppp c 108 0
The method for changing the user name, password, or adding a user is the same as above.

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.