VPNUK - The Virtual Private Network Specialists
The following instructions will guide you through a configuration of DD-WRT compatible routers. There are hundreds of routers compatible with DD-WRT, please check the router database on the DD-WRT website for more information.
IMPORTANT NOTICE: VPNUK cannot assist in the flashing of, or installation of DD-WRT firmware, nor can we be held responsible for damage caused by clients configuring uncompatible routers. Please only install official DD-WRT firmware from the DD-WRT website onto compatible routers. Before you attempt to configure your router please setup a PPTP connection on your computer to ensure the account is working.
If you do choose to configure your connection through DD-WRT, please note, that it is still largely unsupported, if you have any problems we will no be able to help you troubleshoot. You should be prepared to lose internet connectivity and be ready and know how to return the router to it's defaults.
IMPORTANT: A 200MHz processor (most routers' processors) won't reach an optimal speed for some media related services when using PPTP. We strongly recommend all connections to the VPNUK servers over DD-WRT use the OpenVPN setup, its fast, stable and very secure.
1. Version Check
Login to your home router with DD-WRT version v24sp2 or higher on it.

2. Services
Click on the 'Services' tab

3. Go to VPN
Click on the 'VPN' tab in the 'Services' sub menu.

4. Enable PPTP
In the 'PPTP Client Options click onto 'Enable'.

5. IP Address
Enter the IP address of your VPNUK server in 'Server IP or DNS Name'.

6. Remote Subnet
Enter 192.168.100.0 into the 'Remote Subnet' fields. If that doesn't connect once setup is complete please try 10.0.0.0

7. Remote Subnet Mask
Enter 255.255.255.0 into the 'Remote Subnet Mask' fileds.

8. MPPE Settings
Enter 'mppe required,no40,no56,stateless' into the 'MPPE Encryption' field.

9. MTU Settings
Enter '1450' into both the 'MTU' and 'MRU' fields

10. NAT Settings
Set NAT to 'Enable'.

11. Login Details
Enter your username and password in the username and password fields.

12. Apply Settings
Scroll to the bottom of the page and click on 'Apply'.

13. SPI Firewall
We now need to disable the SPI firewall on the device. For this, click on 'Security'.

14. Firewall
Click on the 'Firewall' button.

15. Disable Firewall
Select the 'Disable' checkbox.

16. Save Firewall Settings
Scroll to the bottom of the page and
click on 'Save'.

17. VPN Routing
Now we have to create a simple script that re-routes your internet connection through your VPN. For this, click on 'Administration'.

18. Commands
Click onto the 'Commands' button.

19. Paste the Commands
Paste the following commands into the 'Firewall' Box. You can download a plain text file containing the commands here: https://vpnuk.info/dd-wrt-commands.txt
echo "sleep 40" > /tmp/firewall_script.sh ;
echo "gw=\`ip route ls to 0/0|cut -d ' ' -f3\`" >> /tmp/firewall_script.sh ;
echo "vpnsrv=\$(nvram get pptpd_client_srvip)" >> /tmp/firewall_script.sh ;
echo "dynvpnip=\$(ifconfig ppp0 | grep 'inet addr' | grep -v '127.0.0.1'| awk '{print $2}' | cut -d: -f2)" >> /tmp/firewall_script.sh ;
echo "vpnip=\$(nvram get pptpd_client_srvsub)" >> /tmp/firewall_script.sh ;
echo "route add -host \$vpnsrv gw \$gw" >> /tmp/firewall_script.sh ;
echo "route del default" >> /tmp/firewall_script.sh ;
echo "route add default dev ppp0" >> /tmp/firewall_script.sh ;
echo "iptables -t nat -I POSTROUTING -o ppp0 -j SNAT --to-source \$dynvpnip" >> /tmp/firewall_script.sh ;
echo "for i in \`echo \$(nvram get forward_spec)|sed 's=\ =\n=g'|grep on|grep tcp\` ; do" >> /tmp/firewall_script.sh ;
echo "iptables -t nat -A PREROUTING -p tcp -i ppp0 -d \$dynvpnip --dport \`echo \$i|cut -d : -f 4|cut -d \> -f 1\` -j DNAT --to \`echo \$i|cut -d \> -f 2\`" >> /tmp/firewall_script.sh ;
echo "iptables -A FORWARD -p tcp -i ppp0 -d \`echo \$i|cut -d \> -f 2|cut -d : -f 1\` --dport \`echo \$i|cut -d : -f 4|cut -d \> -f 1\` -j ACCEPT" >> /tmp/firewall_script.sh ;
echo "done" >> /tmp/firewall_script.sh ;
echo "for i in \`echo \$(nvram get forward_spec)|sed 's=\ =\n=g'|grep on|grep udp\` ; do" >> /tmp/firewall_script.sh ;
echo "iptables -t nat -A PREROUTING -p udp -i ppp0 -d \$dynvpnip --dport \`echo \$i|cut -d : -f 4|cut -d \> -f 1\` -j DNAT --to \`echo \$i|cut -d \> -f 2\`" >> /tmp/firewall_script.sh ;
echo "iptables -A FORWARD -p udp -i ppp0 -d \`echo \$i|cut -d \> -f 2|cut -d : -f 1\` --dport \`echo \$i|cut -d : -f 4|cut -d \> -f 1\` -j ACCEPT" >> /tmp/firewall_script.sh ;
echo "done" >> /tmp/firewall_script.sh ;
echo "for i in \`echo \$(nvram get forward_spec)|sed 's=\ =\n=g'|grep on|grep both\` ; do" >> /tmp/firewall_script.sh ;
echo "iptables -t nat -A PREROUTING -p tcp -i ppp0 -d \$dynvpnip --dport \`echo \$i|cut -d : -f 4|cut -d \> -f 1\` -j DNAT --to \`echo \$i|cut -d \> -f 2\`" >> /tmp/firewall_script.sh ;
echo "iptables -A FORWARD -p tcp -i ppp0 -d \`echo \$i|cut -d \> -f 2|cut -d : -f 1\` --dport \`echo \$i|cut -d : -f 4|cut -d \> -f 1\` -j ACCEPT" >> /tmp/firewall_script.sh ;
echo "iptables -t nat -A PREROUTING -p udp -i ppp0 -d \$dynvpnip --dport \`echo \$i|cut -d : -f 4|cut -d \> -f 1\` -j DNAT --to \`echo \$i|cut -d \> -f 2\`" >> /tmp/firewall_script.sh ;
echo "iptables -A FORWARD -p udp -i ppp0 -d \`echo \$i|cut -d \> -f 2|cut -d : -f 1\` --dport \`echo \$i|cut -d : -f 4|cut -d \> -f 1\` -j ACCEPT" >> /tmp/firewall_script.sh ;
echo "done" >> /tmp/firewall_script.sh ; sh /tmp/firewall_script.sh &
|

20. Save settings
Click onto the 'Save Firewall' button.

21. Finalise Installation
Now you have to restart the router. For this, click on 'Management' from the 'Administration' sub menu.

22. Reboot Your Router
Scroll down to the very end of the page and select 'Reboot Router'.

22. Thats It!
You have now successfully setup a VPNUK connection through PPTP on your DD-WRT compatible router. Once your router has rebooted it may take up to 5 minutes for the VPN to enable.
Note: If the VPN does not connect after 5 minutes please try switching the the remote subnet IP to: 10.0.0.0
[END]
|