System environment: This system is based on the system. [Root @ gjp ~] # Cat/etc/redhat-releaseCentOSrelease6.4 (Final) tool: dkms-2.0.17.5-1.noarch.rpmkernel_ppp_mppe-1.0.2-3dkms.noarch.rpmpptpd-1.3.4-2.rhel6.i386.rpmppp-2.4.5-17.0.rhel6.
System environment: This system is based on the system.
[Root @ gjp ~] # Cat/etc/redhat-release
CentOS release 6.4 (Final)
Tools: dkms-2.0.17.5-1.noarch.rpm
Kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm
Pptpd-1.3.4-2.rhel6.i386.rpm
Ppp-2.4.5-17.0.rhel6.narch.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
# Http://poptop.sourceforge.net/yum/stable/rhel6/i386/ppp-2.4.5-33.0.rhel6.i686.rpm
# Http://poptop.sourceforge.net/yum/stable/rhel6/i386/pptpd-1.4.0-1.el6.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-Uvh ppp-2.4.5-33.0.rhel6.i686.rpm
# Rpm-ivh pptpd-1.4.0-1.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 222.85.85.85>/etc/ppp/options.ppt pd
Echo ms-dns 222.88.88.88>/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 }''
The command is enclosed by an anti-mask.
[Root @ gjp ~] # Ifconfig | grep 'inet addr '| grep-v '2017. 0.0.1' | cut-d:-f2 | awk 'NR = 1 {print $1 }'
10.0.3.timeout (obtain the ip address used by the local machine)
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 *
Gjp * 12345 *
Restart the pptp service after configuration.
# Service pptpd start
For more information, see:
Ppp0 Link encap: Point-to-Point Protocol
Inet addr:172.16.36.1P-t-P: 172.16.36.2 Mask: 255.255.255.255
Up pointopoint running noarp multicast mtu: 1396 Metric: 1
RX packets: 1641 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 1502 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 3
RX bytes: 327280 (319.6 KiB) TX bytes: 370597 (361.9 KiB)