Tuesday, 29 January 2013

Linux PPTP Gateway

I've been looking for a suitable environment for my GNS3 software, it is fairly intensive and my laptop isn't really up to it.  What with being stuck abroad also I need a VPN gateway back to the UK so we can, err, stream "content" from the fair Isle.  VPN gateway providers are easily blacklisted, so I wanted my own solution.  I did try EC2 however it is also detected as have Irish origins - which is correct - so this was no good.  Enter Serverlove, by Melbourne Hosting.  Always highly-rated Melbourne hosting so I expected the same from their cloud offering.  Having a VPN server on demand along with a GNS3 server would be ideal, even better as its on demand I could ram up the CPU cycles to something mental like 20GHz if really required.

On-demand 20GHz. processing, 8GB RAM for 32p an hour.  Serious bargain.

PPTP Server


So first of all I needed a PPTP server.  This was fairly easily achieved through some basic trial and error, I'm not a VPN expert but I know enough.

The first thing you must do is install pptpd.  Now, this is pretty easy:

root@ubuntu:/etc/ppp# sudo apt-get install pptpd

Yawn.  Hard life.  Now, you need to edit pptpd.conf which in my case was found in /etc...

root@ubuntu:/etc/ppp# nano /etc/pptpd.conf

You want to be adding in your networks here:

localip 192.168.10.1
remoteip 192.168.10.99-245

My file references the location option /etc/ppp/pptpd-options for which you can make a few tweaks, here however I simply added in the Google DNS

ms-dns 8.8.8.8
ms-dns 8.8.4.4

Now to make the users, which is found in /etc/ppp/chap-secrets

# client        server  secret                  IP addresses
nick    pptpd   xyzpass 192.168.10.100

Now I had a bit of problem, I believe you should be tab separating this file, I will need to confirm this though.

All that remained is to add in a NAT statement and start the pptp server:

root@ubuntu:/etc/ppp# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Nice.  Ok.  So how about GNS3?  I had to stick with my trusty Ubuntu 10.10.  Launching another instance and installing GNS3 is fairly straightforward, though as 10.10 is pretty out of date the UK repos were playing up so you might have to change locations.  Just remember to save yourself the hassle and edit the GNS icon to launch as root:  gksudo gns3...

The when configuring your GNS3 chmod your image/project directories to allow your user account access, otherwise its annoying (I find).

Also, you have your own ISO images, right?



No comments:

Post a Comment

Found this pointless and feel you must comment? Really, there is no need, we are fully aware of the pointlessness of this article. But if you must...

Google+ Followers