Following VPN server setup requests from multiple customers via support tickets, we decided to explain the VPN installation process. To set up your own VPN server, you can purchase the
SSD VDS 1 package from Netinternet at https://www.netinternet.com.tr/vps-sunucular with the Debian 7 operating system and follow the installation steps below.
Phase 1: Installation
After
updating our apt-get repo for installation, we install the aptitude package manager and use it to install pptpd. This brings to mind the age-old question: “Which came first, the chicken or the egg?” :)apt-get update
apt-get install aptitude
aptitude install pptpdPhase 2: SettingsAfter the installation is complete, to determine the local
IP addresses to be used on our VPN server, we open the /etc/pptpd.conf file with any text editor, scroll to the last line, and enter the following parameters.localip 192.168.124.5
remoteip 192.168.124.234-238,192.168.124.245Please note that if there will be multiple
VPN users, they will use these local IP addresses in the VPN network.Note: On minimal Debian, the default text editor is vim. If you have difficulty using vim, you can install the nano editor with apt-get install nano.Then, to configure connection settings, open the
/etc/ppp/pptpd-options file with nano or vim, scroll to the last line, and add the following;noipx
mtu 1490
mru 1490Finally, to define a VPN user and password, open the /etc/ppp/chap-secrets file and add a line in the following format.netinternet *
passwordburaya *To define multiple users, enter a username and password on each line in a similar format. Above, we defined a VPN user with username “netinternet” and password “passwordburaya”.Everything is in order so far. Now, to prepare
the server to run VPN, we need to enable the packet forwarding feature. To do this, open the /etc/sysctl.conf file and remove the # (number sign) character in front of “net.ipv4.ip_forward=1” and save.Then save the file and run the sysctl -p command from the
console.After that, the only remaining task is related to Iptables.iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADEAfter applying the command above, all you need to do to start the VPN service is write the /etc/init.d/pptpd start command.When you add a new VPN
user, you need to restart the VPN service with the /etc/init.d/pptpd restart command.The iptables command written above will not run when the server restarts. Therefore, paste the command above the exit 0 in the /etc/rc.local file and save it — the server will
automatically apply the command every time it starts.If you have any questions about the VPN installation and service usage, please write in the comments section below this knowledge base document.Good Work.
Leave a Comment
* Your comment will be published after approval.
Comments
0No comments yet. Be the first to comment!