VPN Server Installation on Debian OS
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 at https://www.netinternet.com.tr/vps-sunucular with the Debian 7 operating system and follow the installation steps below.
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
pptpdSettings
After 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.
In the meantime, on
minimal Debian, the default text editor is vim. If you have difficulty using vim,
apt-get install nanoyou can install the nano editor. Then, to configure connection settings, open
/etc/ppp/pptpd-options 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
/etc/ppp/chap-secretsand 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
/etc/sysctl.confand remove the # (number sign) character in front of
“net.ipv4.ip_forward=1”and save.
Config Settings
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
/etc/init.d/pptpd startWhen you add a new VPN user, restart the VPN service with
/etc/init.d/pptpd restart The iptables command
written above will not run when the server restarts. Therefore, paste the command above the exit 0 in
/etc/rc.local and save the file — the server will automatically apply the command every time it
starts.
Leave a Comment
* Your comment will be published after approval.
Comments
0No comments yet. Be the first to comment!