Build a VPN service in Centos 6.2

Source: Internet
Author: User

System Environment: This system is based on the Centos 6.2 32-bit system.

Tools: dkms-2.0.17.5-1.noarch.rpm

Kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm

Pptpd-1.3.4-2.el6.i686.rpm

Ppp-2.4.5-17.0.rhel6.i686.rpm

First, download the above tool to/home/download:

# Mkdir-p/home/download

# Cd/home/download

# Wget http://www.hi-vps.com/downloads/dkms-2.0.17.5-1.noarch.rpm

# Wget http://wty.name/linux/sources/kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm

# Wgethttp: // poptop.sourceforge.net/yum/stable/rhel6/ I #/pptpd-1.3.4-2.el6.i686.rpm

# Wgethttp: // poptop.sourceforge.net/yum/stable/rhel6/ I #/ppp-2.4.5-17.0.rhel6.i686.rpm

Continue to install the Library:

# Yum-y install make libpcap iptables gcc-c ++ logrotate tar cpio perl pam tcp_wrappers

Install the following tool:

# Rpm-ivh dkms-2.0.17.5-1.noarch.rpm

# Rpm-ivh kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm

# Rpm-Uvhppp-2.4.5-17.0.rhel6.i686.rpm

# Rpm-ivhpptpd-1.3.4-2.el6.i686.rpm

Change the IP address and DNS address to the DNS address you are using...

Mknod/dev/ppp c 108 0
Echo 1>/proc/sys/net/ipv4/ip_forward
Echo "mknod/dev/ppp c 108 0">/etc/rc. local
Echo "echo 1>/proc/sys/net/ipv4/ip_forward">/etc/rc. local
Echo "localip 172.16.36.1">/etc/pptpd. conf
Echo "remoteip 172.16.36.2-254">/etc/pptpd. conf
Echo "ms-dns 8.8.8.8">/etc/ppp/options.ppt pd
Echo "ms-dns 8.8.4.4">/etc/ppp/options.ppt pd

Firewall Configuration:

Iptables-t nat-a postrouting-s 172.16.36.0/24-j SNAT-to-source 'ifconfig | grep' inet addr: '| grep-V' 127. 0.0.1 '| cut-d:-f2 | awk 'nr = 1 {print $1 }''
Iptables-a forward-p tcp-syn-s 172.16.36.0/24-j TCPMSS-set-mss 1356

Service startup:

Service iptables save

Chkconfig iptables on
Chkconfig pptpd on

Service iptables start
Service pptpd start

Okay. Now, the VPN has been set up...

Create a user as follows:

# Vi/etc/ppp/chap-secrets

The edited content is (IP * indicates all ):

# Secrets for authentication using CHAP
# Client server secret IP addresses
Username pptpd password *

Restart the pptp service after configuration.

# Service pptpd start

This is the end of the tutorial .. How to configure the client. I will not write it here.

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.