[Untitled]‎ > ‎

Set up a PPTP VPN Server(Ubuntu) at home

posted Apr 22, 2010 8:35 AM by J iNestdia   [ updated Dec 9, 2010 10:01 PM ]
P03 Promotion: ZoneAlarm 2010 - 468x60


Set up a PPTP VPN Server in Ubuntu, so that you can connect to it securely and access your home network resources when you away from home. Typically,  a home network behind a router is connected to the Inetrnet via a DSL/Cable modem. Here is my network for example.

Install PPTP VPN Server in Ubuntu

$ sudo apt-get install pptpd
The internal network IP address is 192.168.1.0/24, Ubuntu server IP is 192.168.1.2 and the Airport Extreme Router IP is 192.168.1.1.

$ sudo nano /etc/pptpd.conf
Add the following two lines,
localip 192.168.1.1
remoteip 192.168.1.230-235
(assigns 6 IP addresses for 6 VPN users)

$ sudo nano /etc/ppp/chap-secrets
Add one line,
vpnusername pptpd vpnpassword *

$ sudo nano /etc/rc.local
Add one line before exit0,
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

$ sudo nano /etc/sysctl.conf
uncomment
#net.ipv4.ip_forward=1

then, restart pptpd,
$ sudo /etc/init.d/pptpd restart

Configure router to forward TCP port 1723
The PPTP VPN server is behind a router(Airport Extreme in this case), configure the router to forward TCP port 1723 to the PPTP VPN server(192.168.1.2 in this case).

Using a Dynamic DNS service
Refer to: 
Remote SSH Access to the Homeserver Behind A Router
As I use DynDNS.com in my case,  ddclient running on the server, I can connect the server by the address  myhomeserver.dnydns.com for example.



P02 Promotion: ZoneAlarm 2010 - 300x250 300 x 250 Laptop

Adidas Voucher MY Image Banner 300x250

suki b009 300x250

Phone Spy Image Banner 300 x 250

Scan B 007 300x250

Office Lady Scanner Image Banner 300 x 250