Jump to content

Linux: Howto setup a VPN Server in Debian


Recommended Posts

  • Administrators



This short guide will show you howto setup a VPN server in Debian with ONE network card.



1. Install the required packages


apt-get install pptpd dnsmasq



2. Configure the IP range assigned to clients by running: pico /etc/pptpd.conf





Using this config the clients are assigned any IP address between and including and



3. Create a user allowed to connect by running: pico /etc/ppp/chap-secrets


* *


Passwords are not encrypted. This allows the a user with the username: user1 and the password: secretpassword to login from any ip address.


4. Enable IP forward at startup to allow the VPN clients to connect to the server's local network by running: pico /etc/sysctl.conf




Also run this command to activate the IP forward instantly:


echo 1 > /proc/sys/net/ipv4/ip_forward


5. Create a routing rule to allow the VPN clients to route network traffic through the server.

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE


6. Add DNS configuration to your setup by running: pico /etc/ppp/options











7. Create a virtual network interface for

pico /etc/network/interfaces


Add this:


auto eth0:0

iface eth0:0 inet static




Now.. reboot and enjoy VPN! :)




1) On Ubuntu server, i had to create a "startup" script with the line below in order to enable data routing.

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...