/sc_assets/441/logo.png

DD-WRT PPTP Client Setup

Last updated by Shayne M on September 01, 2013 10:12

For pre-configured VPNSecure DD-WRT or Tomato based routers please purchase a router from Flashrouters.com

Before proceding make sure you currently have internet access through the DDWRT, in this example, we do not connect the DD-WRT WAN (Internet) port, connect an ethernet cable to any of the switch ports on your DD-WRT router. 

You will need to setup a static IP on your computer to use the DD-WRT as your gateway, point this to the IP address of your DD-WRT router.

Browse to  the router’s configuration page and click the ‘Setup’ button in the top menu. 

Make sure that the Local IP Address, Subnet Mask, Gateway, and Local DNS settings are set correctly for your network setup.  The gateway should be the IP address of your existing router.  It's not a good idea to have more then one DHCP server running on your network.

There are two options.

1. Disable the DHCP server on your existing router only if you want all your devices to access the internet via the VPN.

2. Disable DHCP server on the DD-WRT, only if you want certain devices to access the internet via the VPN (This option you will need to set the static gateway IP on your device to that of the DD-WRT router)

Click the ‘Services’ tab in the menu and select ‘VPN’ from the submenu bar. 

Click ‘Enable’ to ‘PPTP Client Options’

Before proceeding you will need to get the server address you wish to connect to from the VPNSecure Members area For example, to connect to a USA server, you’d use ‘pptp-us1.vpnsecure.me’. 

  • Next to ‘Server IP or DNS Name’ enter ‘pptp-us1.vpnsecure.me’
  • Next to ‘Remote Subnet’ enter ’10.168.0.0?.
  • Next to ‘Remote Subnet Mask’ enter ’255.255.255.0?.
  • Next to ‘MPPE Encryption’ enter ‘mppe required,no40,no56,stateless’
  • Next to ‘MTU’ enter ’1450?.
  • Next to ‘MRU’ enter ’1450?.
  • Enable ‘NAT’.
  • Enter your VPNSecure username and password into the ‘User Name’ and ‘Password’ boxes.

Click ‘Save’  then ‘Apply Settings’.

Click the ‘Administration’ tab in the menubar, and choose ‘Commands’ from the sub menu.

Copy and paste the following commands into the Commands Box.

echo "#!/bin/sh" > /tmp/vpnsecure.sh;
echo "/tmp/pptpd_client/vpn stop" >> /tmp/vpnsecure.sh;
echo "cat /tmp/pptpd_client/options.vpn | sed -e 's/lcp-echo-failure 3/lcp-echo-failure 0/g' > /tmp/options.new" >> /tmp/vpnsecure.sh;
echo "rm -Rf /tmp/pptpd_client/options.vpn" >> /tmp/vpnsecure.sh;
echo "mv /tmp/options.new /tmp/pptpd_client/options.vpn" >> /tmp/vpnsecure.sh;
echo "/tmp/pptpd_client/vpn start" >> /tmp/vpnsecure.sh;
echo "echo \`date\` > /tmp/vpnsecureStatus.txt" >> /tmp/vpnsecure.sh;
echo "echo \`nvram get lan_gateway\` >> /tmp/vpnsecureStatus.txt" >> /tmp/vpnsecure.sh;
echo "echo \`nvram get pptpd_client_srvip\` >> /tmp/vpnsecureStatus.txt" >> /tmp/vpnsecure.sh;
echo "echo \`ifconfig\` >> /tmp/vpnsecureStatus.txt" >> /tmp/vpnsecure.sh;
echo "echo \`route -n\` >> /tmp/vpnsecureStatus.txt" >> /tmp/vpnsecure.sh;
echo "echo \"Waiting for VPN UP\" >> /tmp/vpnsecureStatus.txt" >> /tmp/vpnsecure.sh
echo "vpnGatewayTmp=\`ip addr sh dev ppp0 | grep peer | cut -d ' ' -f8 | cut -d '/' -f1\`" >> /tmp/vpnsecure.sh;
echo "while [ \${#vpnGatewayTmp} -eq \"0\" ]; do" >> /tmp/vpnsecure.sh;
echo " vpnGatewayTmp=\`ip addr sh dev ppp0 | grep peer | cut -d ' ' -f8 | cut -d '/' -f1\`" >> /tmp/vpnsecure.sh;
echo " sleep 10" >> /tmp/vpnsecure.sh;
echo "done;" >> /tmp/vpnsecure.sh;
echo "echo \"VPN UP\" >> /tmp/vpnsecureStatus.txt" >> /tmp/vpnsecure.sh;
echo "sleep 10" >> /tmp/vpnsecure.sh;
echo "routeViaLan=\$(nvram get pptpd_client_srvip)" >> /tmp/vpnsecure.sh;
echo "lanGateway=\`ip route show to 0/0 | cut -d ' ' -f3\`" >> /tmp/vpnsecure.sh;
echo "vpnGateway=\`ip addr sh dev ppp0 | grep peer | cut -d ' ' -f8 | cut -d '/' -f1\`" >> /tmp/vpnsecure.sh;
echo "ip route add \$routeViaLan/32 via \$lanGateway" >> /tmp/vpnsecure.sh;
echo "ip route add 0.0.0.0/1 via \$vpnGateway" >> /tmp/vpnsecure.sh;
echo "ip route add 128.0.0.0/1 via \$vpnGateway" >> /tmp/vpnsecure.sh;
echo "iptables -t nat -I POSTROUTING -o ppp0 -j MASQUERADE" >> /tmp/vpnsecure.sh;
echo "echo \"Monitoring VPN Connection\" >> /tmp/vpnsecureStatus.txt" >> /tmp/vpnsecure.sh;
echo "vpnGatewayTmp=\`ip addr sh dev ppp0 | grep peer | cut -d ' ' -f8 | cut -d '/' -f1\`" >> /tmp/vpnsecure.sh;
echo "while [ \${#vpnGatewayTmp} -gt 0 ]; do" >> /tmp/vpnsecure.sh;
echo "vpnGatewayTmp=\`ip addr sh dev ppp0 | grep peer | cut -d ' ' -f8 | cut -d '/' -f1\`" >> /tmp/vpnsecure.sh;
echo " sleep 10" >> /tmp/vpnsecure.sh;
echo "done;" >> /tmp/vpnsecure.sh;
echo "echo \"VPN failed\" >> /tmp/vpnsecureStatus.txt" >> /tmp/vpnsecure.sh;
echo "/tmp/pptpd_client/vpn stop" >> /tmp/vpnsecure.sh;
echo "/sbin/route del -net 0.0.0.0/1 gw \$vpnGateway" >> /tmp/vpnsecure.sh;
echo "/sbin/route del -net 128.0.0.0/1 gw \$vpnGateway" >> /tmp/vpnsecure.sh;
echo "iptables -t nat -D POSTROUTING -o ppp0 -j MASQUERADE" >> /tmp/vpnsecure.sh;
echo "/tmp/vpnsecure.sh &" >> /tmp/vpnsecure.sh;
chmod +x /tmp/vpnsecure.sh;/tmp/vpnsecure.sh &

Click the button that's labled "Save Startup"

Once this is done, please reboot your router, Once the router has been rebooted it should connect to the VPNSecure PPTP Network.

Depending on the options you have chosen at the DHCP setup steps, you may need to set your computers default gateway to that of the DD-WRT


VPNSecure Provides Secure VPN servers in over 45+ Countries

If you are a looking for a versatile easy to use VPN service, checkout Today