The graphic method of establishing VPN on Liunx Broiler _linux

Source: Internet
Author: User
Tags centos iptables
Spent two days studying, feeling pptpd seems to be much simpler, and the success rate is very high. There is no platform limit. This article takes CentOS the newest version 5.2来 to do the VPN server. For textbooks, other distributions are similar.

The first step is to wget the tools you need first.
wget http://poptop.sourceforge.net/yum/stable/packages/dkms-2.0.17.5-1.noarch.rpm
wget http://poptop.sourceforge.net/yum/stable/packages/kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm
These two are necessary. However, it is not necessary to download and install the kernel,5.x in the centos5x release. CENTOS4X and the following needs.
If the CentOS 4 version of the
wget http://poptop.sourceforge.net/yum/stable/packages/ppp-2.4.3-7.rhel4.i386.rpm
wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-1.rhel4.i386.rpm
CentOS 5.
wget http://poptop.sourceforge.net/yum/stable/packages/ppp-2.4.4-7.0.rhel5.i386.rpm
wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-1.rhel5.1.i386.rpm
-------If the other version opens http://poptop.sourceforge.net/yum/stable/packages select the corresponding version number.
(If you don't know if the broiler is the release, enter cat/etc/issue in the shell)
The second step starts the installation.

centos4.x
RPM-IVH dkms-2.0.17.5-1.noarch.rpm
RPM-IVH kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm
RPM-UVH ppp-2.4.3-7.rhel4.i386.rpm
RPM-IVH pptpd-1.3.4-1.rhel4.i386.rpm

centos5.x
RPM-IVH dkms-2.0.17.5-1.noarch.rpm
RPM-IVH kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm [CentOS 5.2 self-belt can not be installed]
RPM-UVH ppp-2.4.4-7.0.rhel5.i386.rpm
RPM-IVH pptpd-1.3.4-1.rhel5.1.i386.rpm
(If the installation process is unsuccessful, look at the error message, probably what is missing from the broiler.) but he is short of anything and we will make up for it.
such as Gcc:yum install gcc-c++ Zlib-devel:yum install Zlib-devel, distribution different automatic upgrade command different, I centos here is yum)
The third step is to modify the four files that need to be modified.
1.vi/etc/modprobe.conf Add alias net-pf-7 Ip_gre


2.vi/etc/pptpd.conf Remove PPP/USR/SBIN/PPPD Front #

Comment out Logwtmp

Modify the following IP

3vi Editor/ETC/PPP/OPTIONS.PPTPD
Modify DNS, which is assigned after dial-in.

Remove the dump annotation character. # (said on the Internet also remove debug, but we do not, after all, the server is not their own)
Finally edit vi/etc/ppp/chap-secrets to user rights and assign IP

Format: User, service password * (wildcard)
Now change the firewall configuration.
Vi/etc/sysconfig/iptables let 1723 external development and UDP 53.

after the

is edited, reboot the firewall so that the configuration takes effect/etc/init.d/iptables restart

At this point, you can dial into the VPN normally. However, Now dial in to only communicate with the server can not be on the network.:)

continues to execute
iptables-t nat-f
iptables-t nat-a postrouting-s xx.xx.xx (IP allocated after dial-in) in the shell-j SNAT--to xx.xx . XX server IP
haha, now quit and dial in to see if you can surf the Internet? Hey, but now, if the server reboots, the next time you dial in, you won't be able to surf the Internet. Then we save the firewall configuration/etc/rc.d/init.d/iptables save.
   ha
Last edited vi/etc/sysctl.conf
Net.ipv4.ip_forward = 0 to 999

finally set PPTPD to start
chkconfig--add pptpd
chkconfig--level on

Hey, then clear the diary! An efficient VPN chicken was born!

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.