레이블이 ppp인 게시물을 표시합니다. 모든 게시물 표시
레이블이 ppp인 게시물을 표시합니다. 모든 게시물 표시

20131020

Install VPN PPTP Server on CentOS 6

At this moment, my designer encounter problem to access target.com, an online shopping website to see some of the stuff for their design work. Target.com only allowed connections from USA and Canada at this moment due to their website crash issue last couple of weeks. Since this is quite urgent, I need to setup a VPN server so they can use it as a jump point to access websites in USA and Canada. I will use my MySQL server to serve as VPN server as well.
In this tutorial, I will use pptp as protocol to connect to VPN server using a username and password, with 128 bit MPPE encryption. Variable as below:
OS: CentOS 6 64bit
VPN server:  10.10.0.1
VPN client IP: 10.10.0.100 - 199
1. Install ppp, pptp :
$ rpm --import http://poptop.sourceforge.net/yum/RPM-GPG-KEY-PPTP
$ rpm -Uvh http://poptop.sourceforge.net/yum/stable/rhel6/pptp-release-current.noarch.rpm
$ yum install ppp pptpd -y
2. Once installed, open /etc/pptpd.conf using text editor and add following line:
localip 10.10.0.1
remoteip 10.10.0.100-199
3. Open /etc/ppp/options.pptpd and add  authenticate method, encryption and DNS resolver value:
require-mschap-v2
require-mppe-128
ms-dns 8.8.8.8
ms-dns 8.8.4.4
4. Lets create user to access the VPN server. Open /etc/ppp/chap-secrets and add the user as below:
USERNAME pptpd PASSWORD *
5. We need to allow IP packet forwarding for this server. Open /etc/sysctl.conf via text editor and change line below:
net.ipv4.ip_forward = 1
6. Run following command to take effect on the changes:
$ sysctl -p
7. Allow IP masquerading in IPtables by executing following line:
$ echo "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE" >> /etc/rc.local
$ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Update: Once you have done with step 8, check the rules at /etc/sysconfig/iptables. Make sure that the POSTROUTING rules is above any REJECT rules.
8. Start the server:
$ service pptpd start
Once the server is online after reboot, you should now able to access the PPTP server from the VPN client. You can monitor /var/log/messages for ppp and pptpd related log. Cheers!


Articles