Setting up pptpd on debian

Posted by: Admin  :  Category: Warez Hosting

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

There are other giudes to do this, but none seemed complete, I had to get the iptables rules from the debug document on poptop.org. I guess they are not always needed.

I started with a clean install of lenny from http://rackspacecloud.com.

Install poptop

# aptitude install pptpd

Edit pptpd config files

/etc/pptpd.conf

You need to set the private ip of the server and the ip range for clients, the 2 lines are added to this file:

localip 192.168.0.1
remoteip 192.168.0.10-20

Set them to whatever private (or public) ip addressing you want. You could use IP addresses currently available in your network, if you do this you will not need to add the iptables rules for natting later in this guide.

/etc/ppp/pptpd-options

Option 1
Set ms-wins and ms-dns to the name server the server you are currently working on is using (look in reolv.conf).

Option 2
Or as I did install dnsmasq on the server and run it as a chaching dns server

# aptitude install dnsmasq

And then set ms-dns and ms-wins to 192.168.0.1 (or the localip you set)

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

/etc/ppp/chap-secrets

Setup users and passwords to connect the pptp server

username pptpd somepassword *

Turn on IP Forwarding

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

Set the change permanantly in /etc/sysctl.conf by uncommenting the line:

net.ipv4.ip_forward=1

Turn on NATing

If you have created a new private network for your pptpd server, you probably have, you need to add a rule to iptables.

# iptables –table nat –append POSTROUTING \
–out-interface eth0 –jump MASQUERADE

But this rule needs be persistant so we need to create a script to run when the interface starts up

# iptables-save > /etc/iptables.conf

Create a new file: /etc/network/if-up.d/iptables and paste in the following

#!/bin/sh
/sbin/iptables-restore < /etc/iptables.conf

Set it to executable
# chmod 755 /etc/network/if-up.d/iptables

All Done!. Just startup pptpd

# /etc/init.d/pptpd start

THE WAREZ PLANET |WAREZ HOSTING | OFFSHORE HOST | OFFSHORE HOSTING

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

Leave a Reply

*