HowTo Setup VPN Server On Debian 5.0 Lenny
Setting Up VPN Server On Debian 5.0 Lenny
1. Install pptpd
apt-get install pptpd
2. Enable IP Forwarding
edit /etc/sysctl.conf, uncomment following
#net.ipv4.ip_forward=1
3. Configure pptpd
Edit /etc/pptpd.conf
Add local ip (server’s ip) and remote ips (range of ips which can be offered to clients)
e.g.
localip 10.0.0.1
remoteip 10.0.0.21-40,10.0.0.51
4. Configure DNS Servers
Edit /etc/ppp/pptpd-options
Add dns servers to ms-dns. You could add 8.8.8.8 and 8.8.4.4 as shown below which are public dns provided by google.
e.g.
ms-dns 8.8.8.8
ms-dns 8.8.4.4
5. Add Users Authentication to /etc/ppp/chap-secrets
# Secrets for authentication using CHAP
# client server secret IP addresses
test pptpd test *
6. Restart pptp daemon
/etc/init.d/pptpd restart
7. Open tcp port 1723 on your router/firewall to be able to connect to the vpn server from the world.
8. Test Connection
Automatic Approach:
We, at Initcron Labs have created a script which automates all the steps above and sets up pptp vpn server within a minute. You can download it from the following link or use wget to do so.
INITCRON Script : http://bin.initcron.org/setup/pptp_vpn_on_debian_lenny.sh
Example Usage:
1. Copy the script using wget
wget -c http://bin.initcron.org/setup/pptp_vpn_on_debian_lenny.sh
2. Run the script as root user
bash pptp_vpn_on_debian_lenny.sh
11 Responses to HowTo Setup VPN Server On Debian 5.0 Lenny
Leave a Reply Cancel reply
Resources












Hi !
Thanks for this very helpful tutorial ! I’ve done everything as you said, and it almost works. But when i’m trying to connect my mac to my server, i have this problem ( http://www.debianhelp.org/node/11630 ).
I really can’t authentificate, do you have an idea ?
Thanks for your help
Bastien
you forgot “/etc/ppp/chap-secrets
” in step Add Users Authentication
You forgot info about which file to edit in #5:
5. Add Users Authentication
Edit the file /etc/ppp/chap-secrets
# Secrets for authentication using CHAP
# client server secret IP addresses
test pptpd test *
Thanks Petros and Lars, I have updated #5
I’d got some strange error:
Plugin /usr/lib/pptpd/pptpd-logwtmp.so loaded.
pptpd-logwtmp: $Version$
using channel 45
Using interface ppp0
Connect: ppp0 /dev/pts/2
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfReq id=0x0 ]
sent [LCP ConfAck id=0x0 ]
rcvd [LCP ConfReq id=0x1 ]
sent [LCP ConfAck id=0x1 ]
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfReq id=0x2 ]
sent [LCP ConfAck id=0x2 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfReq id=0x3 ]
sent [LCP ConfAck id=0x3 ]
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfReq id=0x4 ]
sent [LCP ConfAck id=0x4 ]
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfReq id=0x5 ]
sent [LCP ConfAck id=0x5 ]
sent [LCP ConfReq id=0x1 ]
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfReq id=0x6 ]
sent [LCP ConfAck id=0x6 ]
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfReq id=0x7 ]
sent [LCP ConfAck id=0x7 ]
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfReq id=0x8 ]
sent [LCP ConfAck id=0x8 ]
LCP: timeout sending Config-Requests
Connection terminated.
Modem hangup
8?
thanks to u for guide the above lines. but cn u help me how to connect two or more racoon clients through this pptp server. also i would like to ping host to host of different racoon clients and also host of pptp server.
Using the script, or after manually changing net.ipv4.ip_forward=1 in /etc/sysctl.conf – you’ll need to run: sysctl -p in order to activate ip forward, otherwise your VPN connection will only have access to the VPN server, not the rest of the network.
/Tim
Thanks Tim. Much appreciated. I’ll add sysctl -p to the script.
i ran the script and i can connect no problem but some how i can´t get internet
Bum bum, when I ran Lenny, the setup using your script worked perfectly. Now I’ve upgraded to squeeze, and it doesn’t really work anymore
My client can connect and authenticate, but get’s thrown off after 1.3 minutes – while connected, client cannot ping or access anything on the network.
I’ve tried messing around with the localip/remoteip settings, but that didn’t make any difference, and I don’t really think that would be the issue.
Also during my tests, i’m connected to my box, from work using ssh, tailing the log and stuff, connect to the VPN using wifi at work – while my phone is connected, it somehow freezes my SSH connection, even though it’s from a different client.
Any ideas?
Thanks.