{"id":1295,"date":"2010-04-10T21:27:37","date_gmt":"2010-04-10T15:27:37","guid":{"rendered":"http:\/\/www.dotcomunderground.com\/blogs\/?p=1295"},"modified":"2010-04-10T21:30:46","modified_gmt":"2010-04-10T15:30:46","slug":"poptop-pptp-centos5-installation-setup","status":"publish","type":"post","link":"https:\/\/www.dotcomunderground.com\/blogs\/2010\/04\/10\/poptop-pptp-centos5-installation-setup\/","title":{"rendered":"PPTP on CentOS 5 Quick Setup"},"content":{"rendered":"<p>The Point-to-Point Tunneling Protocol (PPTP) is a method for implementing virtual private networks (VPN).<\/p>\n<p>Apart from security, a PPTP VPN allows you to use a static ip address of your server for all your internet connection. A great way to get static ip if you are on an ISP that only provides dynamic ip to clients.<\/p>\n<p>As Windows XP, Windows VISTA, Windows 7, iPhone, iPod Touch, iPad everything comes with a built-in PPTP Client, PPTP is the easiest way to use VPN without the requirement for any software installation.<\/p>\n<p>I personally find paying $5-$10 for a VPN account from the VPN Account\/Service Provider when you can grab a VPS at $10 or Dedicated Web Server at $49. Specially if you already have a dedicated server running for some purposes.<\/p>\n<p>So here is a quick setup guide to install and configure a PPTP server on your CentOS 5 server. It will take just around 5 minutes.<\/p>\n<p>1st we need to install poptop.<br \/>\n<code>rpm -Uvh http:\/\/poptop.sourceforge.net\/yum\/stable\/rhel5\/pptp-release-current.noarch.rpm<\/code><br \/>\n<code>yum --enablerepo=poptop-stable install pptpd<\/code><\/p>\n<p>Edit <strong>\/etc\/pptpd.conf<\/strong> and add the lines to bottom:<br \/>\n<code>localip 10.10.1.1<\/code><br \/>\n<code>remoteip 10.10.1.2-254<\/code><br \/>\nHere <strong>localip<\/strong> (10.10.1.1) is the ip which the clients connect to the server. It can be the primary ip address of your server.<br \/>\n<strong>remoteip<\/strong> (10.10.1.2-254) is the ip address range that will be provided to the client connections.<br \/>\nCommenting out remoteip worked fine with me which gives all connected connection the main ip (localip) of the server.<\/p>\n<p>Now edit <strong>\/etc\/ppp\/options.pptpd<\/strong>.<br \/>\nFind the ms-dns entry, uncomment them and modify the dns ip address with your own dns like this:<br \/>\n<code>ms-dns 192.168.1.1<\/code><br \/>\n<code>ms-dns 192.168.3.1<\/code><br \/>\nRemember to replace 192.168.1.1 and 3.1 with your own dns servers, this will be allocated to the connecting clients.<\/p>\n<p>Let\u00e2\u20ac\u2122s configure the Encryption section, make sure it looks like this:<br \/>\n<code>refuse-mschap<\/code><br \/>\n<code>require-mschap-v2<\/code><br \/>\n<code>require-mppe-128<\/code><br \/>\n<code>require-mppe<\/code><\/p>\n<p>To add PPTP VPN clients you need to edit <strong>\/etc\/ppp\/chap-secrets<\/strong> and add an entry for each client in this way:<br \/>\n<code>USER pptpd PASSWORD \"*\"<\/code><\/p>\n<p>If you wish to provide a static dedicated ip to the client, put the line in this way:<br \/>\n<code>USER pptpd PASSWORD 10.10.1.2<\/code><\/p>\n<p>Run the following command to enable the pptpd to start automatically in runlevel 3 and 5:<br \/>\n<code>chkconfig --level 35 pptpd on<\/code><\/p>\n<p>For pptpd to work, the packet forwarding must be enabled. Edit <strong>\/etc\/sysctl.conf<\/strong> and change the line to:<br \/>\n<code>net.ipv4.ip_forward = 1<\/code><\/p>\n<p>To enable it immediately, run the following command:<br \/>\n<code>sysctl -p<\/code><\/p>\n<p>Now we need to setup iptables:<br \/>\n<code>iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE<\/code><br \/>\n<code>iptables -A INPUT -i eth0 -p tcp --dport 1723 -j ACCEPT<\/code><br \/>\n<code>iptables -A INPUT -i eth0 -p gre -j ACCEPT<\/code><br \/>\n<code>iptables -A FORWARD -i ppp+ -o eth0 -j ACCEPT<\/code><br \/>\n<code>iptables -A FORWARD -i eth0 -o ppp+ -j ACCEPT<\/code><br \/>\n<code>iptables -A OUTPUT -p tcp --dport 1723 -j ACCEPT<\/code><br \/>\n<code>iptables -A OUTPUT -p gre -j ACCEPT<\/code><\/p>\n<p>In order to make the live chats (yahoo, msn, google, etc) work as it should we need to modify the default MTU, this is done by adding the following line into <strong>\/etc\/ppp\/ip-up<\/strong>:<br \/>\n<code>ifconfig $1 mtu 1400<\/code><br \/>\nAdd it before \u00e2\u20ac\u0153exit 0\u00e2\u20ac\u00b3, don\u00e2\u20ac\u2122t add it after \u00e2\u20ac\u0153exit 0\u00e2\u20ac\u00b3, if you do then this command will be ignored, exit 0 stands for \u00e2\u20ac\u0153The script ends here\u00e2\u20ac\u009d. <\/p>\n<p>Finally start the service.<br \/>\n<code>service pptpd start<\/code><\/p>\n<p>Enjoy VPN on your own server :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Point-to-Point Tunneling Protocol (PPTP) is a method for implementing virtual private networks (VPN). Apart from security, a PPTP VPN allows you to use a static ip address of your server for all your internet connection. A great way to get static ip if you are on an ISP that only provides dynamic ip to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,9,13],"tags":[213,126,215,127,214],"class_list":["post-1295","post","type-post","status-publish","format-standard","hentry","category-tech","category-tips","category-tutorials","tag-centos","tag-linux","tag-pptp","tag-unix","tag-vpn"],"_links":{"self":[{"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/posts\/1295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/comments?post=1295"}],"version-history":[{"count":0,"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/posts\/1295\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/media?parent=1295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/categories?post=1295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dotcomunderground.com\/blogs\/wp-json\/wp\/v2\/tags?post=1295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}