17 January 2012

How to: Setup a VPN Server with DD-WRT

A VPN allows you to log into your home/office network and route all traffic via there so it’s as if your laptop/remote device was browsing the network (shared folders, internet etc.) from within the home/office.
Firstly A Word on Protocols
VPNs can be used with a number of different protocols you should consider:
  • What kind of remote users are you supporting: e.g. remote client access or site-to-site (SSTP does not support site-to-site VPN tunnels).
  • Users’ device capabilities e.g. does their smartphone support the chosen protocol.
  • Access requirements: e.g. SSTP connections are tunnelled over SSL using TCP port 443 which is open on most firewalls. Other protocols require UDP ports 1701, 500 and 4500 none of which are open in a standard firewall setup, meaning no connection.
Use DD-WRT On Your Router
I use the excellent DD-WRT software on my router which I have posted about before. It has the ability to allow a basic VPN setup inbuilt. See the wiki entry for more information but basically:
  1. Open the web interface http://192.168.1.1 and go to Services; VPN.
  2. Set PPTP Server to Enabled
  3. Enter the router’s IP as Server IP
  4. Enter an IP range for connecting clients e.g. 192.168.200-10
  5. Enter your username and password into CHAP-Secrets in the format exactly as below including the *’s and spaces:
    username * password *
  6. Click Apply Settings
In order to use this service externally you will need to use a service like http://dyndns.com to maintain an up to date DNS IP record for your network see my previous post.
On Your Computer/Portable Device
Windows 7
  1. Control Panel; Network and Sharing Center; Setup a new connection; Connect to a Workplace
  2. If you have a VPN already choose No, create new connection.
  3. Enter the hostname of your router e.g. myrouter.dyndns.org and give it a name.
  4. Enter the Username and Password
  5. Click connect.
  1. System, Preferences, Network
  2. Click the plus sign at the bottom of the list
  3. Set:
    Interface: VPN
    VPN type: PPTP
    Service name: [your service name here e.g. vpn.mydomainname.com
    Click Create
  4. In Status page set server address: [your domain] account name and set authentication password.
  5. Click Apply then Connect

Android 2.3
  1. Settings; Wireless and Network; VPN Settings; Add VPN
  2. Select Add PPTP VPN
  3. Enter the hostname as VPN name and server.
  4. Select Menu, Save
  5. Click on the VPN and enter the username/password and click connect.

2 comments:

  1. Very excellent chance for people who are during this field, attempt to learn and find one thing from this, smart work keep it up
    __________________
    Home DDWRT VPN Routers

    ReplyDelete
  2. What kind of remote users are you supporting: e.g vpn tunnel . remote client access or site-to-site (SSTP does not support site-to-site VPN tunnels).

    ReplyDelete