Install pptp vpn Server on CentOS

Source: Internet
Author: User

Install pptp vpn Server on CentOS

1. Verify ppp
Run the cat command to check whether ppp is enabled. Generally, servers are enabled except for special VPS hosts.
[root@localhost1 /]# cat /dev/ppp
cat: /dev/ppp: No such device or address
If the above result is displayed in cat, it indicates that ppp is enabled and pptp can be configured properly.

2. Install PPP
[root@localhost1 /]# yum -y install ppp iptablesGenerally, iptables is installed after the system is installed by default. iptables is installed for NAT so that the PPTP client can access the Internet through the PPTP server.

3. Install PPTP
[root@localhost1 ~]# rpm -ivh pptpd-1.3.4-2.el6.x86_64.rpmThe above is for 64-bit systems. This package cannot be used for yum installation. You need to download an rpm package that supports 32-bit or 64-bit systems from the Internet. <Br>

4. Configure pptp
[root@localhost1 /]# vi /etc/pptpd.confAdd the following two lines at the bottom. The localip is the IP address of the pptp server, and the remoteip is the IP address range obtained by the client.
Localip 192.168.100.100
Remoteip 192.168.100.101-110

Modify the options.ppt pd File
[root@localhost1 /]#vi/etc/ppp/options.pptpdOpen the following field and modify it to the dns server you want to allocate to the VPN user.
Ms-dns 8.8.8.8
Ms-dns 8.8.4.4

Add the vpn account and password[root@localhost1 /]#vi /etc/ppp/chap-secretsAdd an account in one row. Each account needs to add four fields: User Name, service, password, and assigned IP address (if the IP address is *, it indicates random allocation, the allocation range is pptp. conf)

# clientserversecret IP addresses
hmj pptpd hmj123 *
5. Enable ip Forwarding
[root@localhost1 /]#vi /etc/sysctl.confChange net. ipv4.ip _ forward to 1,

Save and exit, and execute the following command to make the Kernel configuration take effect:[root@localhost1 /]#sysctl -p6. Configure iptables forwarding
[root@localhost1 /]#iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -j SNAT --to-source58.33.244.126This command allows the IP address of 192.168.100.0 to access the Internet through the public IP address 58.33.244.126.
Replace 192.168.100.0/24 with your IP address in pptp. replace 58.33.244.126 with the public ip address of your server. Otherwise, you can only access the Intranet.

Save iptables configurations
[root@localhost1 /]#service iptables save7. Start the service
[root@localhost1 /]# service pptpd start
[root@localhost1 /]# service iptables start
Configure the service to start automatically upon startup
[root@localhost1 /]#chkconfig pptpd on
[root@localhost1 /]#chkconfig iptables on
Now that the configuration is complete, you can use a common PC to establish a VPN (encrypted by default) connection ..

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.