Saturday, 28 September 2013

PPPT VPN


Please bear in mind that PPTP vpn is less secure than openvpn. If you want to know why please ask Goolgle.
If you don't mind and you think PPPT is secure enough for you go ahead and run the following commands and you'll be ready in less than five.
# sudo apt-get update
# sudo apt-get upgrade
# sudo modprobe ppp-compress-18 - this command should return no errors used for mppe support
# sudo apt-get install pptpd
sudo pico /etc/pptpd.conf
Uncomment the following lines
localip 192.168.1.10
remoteip 192.168.0.25-27,192.168.0.30

"localip" - the IP is the device that is going to be running the VPN 
"remoteip" - is the t
he IP addresses that will be handed out to the clients connecting to you VPN.
Cntrl+o Cntrl+x
# sudo pico /etc/ppp/pptpd-options
Add the follow text on the bottom
ms-dns 192.168.1.1
noipxmtu 1490
mru 1490
Where the IP used for the ms-dns directive is the DNS server for the local network 

Cntrl+o Cntrl+x

# sudo pico /etc/ppp/chap-secrets
myusername[TAB]*[TAB]mypa55w0rd[TAB]*

Cntrl+o Cntrl+x
# sudo service pptpd restart
[ENTER]
To enable forwarding if you wish to have access to your entire home network while away. Edit the ‘sysctl’ file.
# sudo pico  /etc/sysctl.confFind “net.ipv4.ip_forward=1” and uncomment it (or change =0 to =1) 

Cntrl+o Cntrl+x.
# sudo sysctl -p
Last step: Adding iptables rule:
# sudo pico /etc/rc.local

Add this line just above “exit 0”

sudo iptables -t nat -A POSTROUTING -s 192.168.0.25/24 -o eth0 -j SNAT --to 192.168.1.10
Cntrl+o Cntrl+x

Now forward port 1723 in your router/modem 


Done