Quantcast
Channel: » Linux
Viewing all articles
Browse latest Browse all 15

Create a little VPN Server with PPTP to Windows or MAC Clients

$
0
0

In this post i will explain how to create a PPTP VPN server.

*** Remember, this is not a corporate solution, this is a homemade VPN, doesn’t focused on security or h.a. questions, is just a system to access your files in your home…install this Debian on virtual machine ( virtual box/vmware ) and left running in your private networking.

Let’s Start….

1) Download Debian Net Install here (why Debian? why Net Install? First because is tiny, second because is free, third because you will not need more than this)

2 ) After install Debian, fix your ip (don’t forget gateway)

3) Install PPTPD ( apt-get install pptpd)

4) Stop service ( service pptpd stop )

5) Create user and password for you VPN, edit the file /etc/ppp/chap-secrets, and add a new line, like this:

pptpd

6) Create the follow rules in iptables

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

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

/sbin/iptables -A FORWARD -i eth0 -o ppp0 -m state – -state RELATED,ESTABLISHED -j ACCEPT

/sbin/iptables -A FORWARD -i ppp0 -o eth0 -j ACCEPT

6) Save iptables rules in a file

iptables-save > /etc/iptables.up.rules

7) Create start up file in /etc/network/if-pre-up.d/iptables and add these lines:

#!/bin/bash

/sbin/iptables-restore < /etc/iptables.up.rules

8) Change the file to executable mode

chmod +x /etc/network/if-pre-up.d/iptables

9) Enable IP Forward, editing the file /etc/sysctl.conf and create this line:

net.ipv4.ip_forward = 1

10) Edit /etc/ppp/pptpd-options and create a DNS entry (i like Google DNS, but you can use you DNS Server)

ms-dns 8.8.8.8

ms-dns 8.8.44

11) Start Service

service pptpd start

12) Remember open/forward to your server open port number 1723

13) Configure PPTPD Client and use…

*** For MAC OSX remember use this flag in advanced option:

mac conf


Viewing all articles
Browse latest Browse all 15

Trending Articles