{"id":1133,"date":"2013-06-17T20:04:38","date_gmt":"2013-06-18T01:04:38","guid":{"rendered":"http:\/\/swildow.darktech.org\/wp\/?p=1133"},"modified":"2013-06-18T15:26:30","modified_gmt":"2013-06-18T20:26:30","slug":"the-easiest-way-to-build-your-own-vpn-server","status":"publish","type":"post","link":"http:\/\/www.wildow.com\/blog\/?p=1133","title":{"rendered":"The easiest way to build your own VPN server"},"content":{"rendered":"<h1 id=\"post-831\"><a title=\"Permanent Link: The easiest way to build your own VPN server\" href=\"http:\/\/dallascao.com\/en\/the-easiest-way-to-build-your-own-vpn-server\/\" rel=\"bookmark\">The easiest way to build your own VPN server<\/a><\/h1>\n<div>\n<div>Posted by\u00a0<strong><a title=\"Posts by Dallas\" href=\"http:\/\/dallascao.com\/en\/author\/Dallas\/\" rel=\"author\">Dallas<\/a><\/strong><\/div>\n<div>March 13, 2012<\/div>\n<\/div>\n<p>Some people suggest that maybe you should try to build your own vpn server yourself! Indeed it\u2019s not rocket science but still it needs someone to show you the rope. I am not going to be very detailed in each step but you can research them separately.<\/p>\n<p><strong><!--more--><\/strong><\/p>\n<p><a href=\"http:\/\/dallascao.com\/en\/the-easiest-way-to-build-your-own-vpn-server\/\">http:\/\/dallascao.com\/en\/the-easiest-way-to-build-your-own-vpn-server\/<\/a><\/p>\n<p><strong>Step one: First get a VPS<\/strong><\/p>\n<p>get a Linux VPS. A VPS is shortened for Virtual Private Server. It\u2019s not a whole machine (too costly!) but one portion of a machine. A 256 Ram VPS is about 60-90 USD a year and that\u2019s all you have to pay. And if you manage to sell your VPN accounts, you can even make profits!<\/p>\n<p>Recommended provider:\u00a0<strong>http:\/\/www.enzu.com\/account\/aff.php?aff=184<\/strong><\/p>\n<p>You need to get a VPS with linux Centos (other systems will work but I only know centOS) installed. After purchasing you will get an IP for your VPS, and a SSH (never mind those terms. Nobody knows what they are) account.<\/p>\n<p>One thing to remember though. You VPS has to be using Xen (again never mind these terms. Just look for Xen VPS) not openVZ. openVZ is a lot cheaper but it won\u2019t work.<\/p>\n<p><strong>Step two: install PPTP server application on your VPS<\/strong><\/p>\n<p>Use Putty (software name) to log on to your remote VPS using the IP and SSH account provided. And you get a DOS like black Window with a command line like this:<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/breakwall.net\/promo\/remote_command_line.png\" \/><\/p>\n<p>Type at the command line:<\/p>\n<pre>wget https:\/\/breakwall.net\/promo\/pptpd.sh<\/pre>\n<p>And press enter<br \/>\nThen type at the command line:<\/p>\n<pre>bash pptpd.sh<\/pre>\n<p>to run the script.<\/p>\n<p>PPTP server application will be installed on your VPS. At the end of the installation, the script will create an VPN account for you (a username and a password).<\/p>\n<p>That\u2019s it. You now get your own VPN account on your own server! Now you can use the username and password and the IP of your server to log on. Of course you will need to do a simple set up on your Windows or iPad or Android phone like with a VPN account you get from a VPN service provider.<\/p>\n<p><strong>Step three: sell your VPN accounts!<\/strong><\/p>\n<p>I am just kidding. It takes a lot more to run a VPN business. But soon you will want to impress your friends by creating an VPN account on your server for them too!<\/p>\n<p>It\u2019s easy to add VPN accounts. Just edit a file \u201c\/etc\/ppp\/chap-secrets\u201d on your folder. Wait.. how do you do that? You easiest way for people who are unfamiliar with linux is perhaps using FTP!<\/p>\n<p>1. Download and install FileZilla (FTP client software).<br \/>\n2. Click \u201csite manager\u201d (the first button on the tool bar) and click add site<br \/>\nFor Host field: type your server IP.<br \/>\nFor Protocol: choose SFTP<br \/>\nFor Login type: choose General<br \/>\nThen input your SSH account (not your VPN account!,the one that you VPS provider gives you) . The user name is usually \u201croot\u201d.<br \/>\n3. Click \u201cConnect\u201d and then you open your sever.<br \/>\nGo to \/etc\/ppp\/ and then download the file \u201cchap-secrets\u201d. Edit that file with notepad and add a line:<\/p>\n<pre>newaccountname pptpd password *<\/pre>\n<p>4. Save the file and upload to the server to replace the old file.<\/p>\n<p>Last but not least, you need to use you SSH account to log on your server command line using Putty again (like in step two) and then type:<\/p>\n<pre>service pptpd restart<\/pre>\n<p>For your new account to take effect.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>make the following changes to get it to work on my vps, using webmin<\/strong><\/li>\n<\/ul>\n<p>require\u00a0 authentication &#8211; Always<\/p>\n<p>chap authentication &#8211; Must be Used<\/p>\n<ul>\n<li><strong>\u00a0Also had to do the following<\/strong><\/li>\n<\/ul>\n<pre>nano -w \/etc\/sysctl.conf\r\n\r\n# Controls IP packet forwarding\r\nnet.ipv4.ip_forward = 1<\/pre>\n<p>Finally, apply our new sysctl settings. Start the server and assure that it starts automatically on boot:<\/p>\n<pre>sysctl -p\r\nthen restart pptg\r\n\r\n\r\n\r\n<\/pre>\n<p><strong>for ipsec\/l2tp vpn<\/strong><\/p>\n<p>\/ppp profile<br \/>\nadd change-tcp-mss=yes dns-server=192.168.101.1 local-address=192.168.101.1 name=VPN_server_profile \\<br \/>\nremote-address=vpn_pool_pokus<\/p>\n<p>\/ppp secret<br \/>\nadd name=ppp_secret password=ppp_pass profile=VPN_server_profile service=l2tp<\/p>\n<p>\/ip ipsec peer<br \/>\nadd exchange-mode=main-l2tp generate-policy=port-override hash-algorithm=sha1 my-id-user-fqdn=myrouter.mydomain.cz \\<br \/>\nnat-traversal=yes secret=VPN_secret<\/p>\n<p>\/ip firewall filter<br \/>\nadd chain=input protocol=icmp<br \/>\nadd chain=input connection-state=established<br \/>\nadd chain=input connection-state=related<br \/>\nadd chain=input protocol=ipsec-esp<br \/>\nadd chain=input protocol=gre<br \/>\nadd chain=input comment=&#8221;L2TP VPN&#8221; dst-port=500,4500,1701 protocol=udp src-port=&#8221;&#8221;<br \/>\nadd action=drop chain=input in-interface=wan<br \/>\n\/ip firewall nat<br \/>\nadd action=masquerade chain=srcnat out-interface=wan<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The easiest way to build your own VPN server Posted by\u00a0Dallas March 13, 2012 Some people suggest that maybe you should try to build your own vpn server yourself! Indeed it\u2019s not rocket science but still it needs someone to &#8230; <a class=\"more-link\" href=\"http:\/\/www.wildow.com\/blog\/?p=1133\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1133"}],"collection":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1133"}],"version-history":[{"count":7,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1133\/revisions"}],"predecessor-version":[{"id":1135,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1133\/revisions\/1135"}],"wp:attachment":[{"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1133"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}