DD-WRT setting VPN connection method, with custom website traffic diversion rules attached
Summary:DD-WRT is a Linux based router firmware. If your router does not natively support VPN connections, you can consider flashing it to DD-WRT for use. Of…
This book is available as an e-book in EPUB format
PayPal sponsors this website for any amount. I will send you an EPUB e-book via email. Please send me an email
Email: shuxueha@outlook.com
PayPal: https://paypal.me/zhipinglei
You can also scan the PayPal QR code below to sponsor
You can also purchase this book on Amazon: click to enter the Amazon official website
DD-WRT is a Linux based router firmware. If your router does not natively support VPN connections, you can consider flashing it to DD-WRT for use. Of course, there are risks involved in flashing the device, and it requires a certain level of operational understanding to act within one's capabilities. Compared to traditional router firmware, DD-WRT provides more extended features, including PPTP VPN and OpenVPN connection support. Next, let's introduce how to set up a VPN connection for DD-WRT.
1、 DD-WRT VPN Connection Setting Method
1. Firstly, you need a DD-WRT router. If you don't have one, you can consider flashing it. The router models suitable for DD-WRT flashing can be viewed here. As for the flashing method, it has already been introduced on the official website. If you don't know, you can search online to see other people's experiences. I won't go into detail here.
2. Secondly, you need a VPN account, which can be obtained from our curated list of selected and free VPNs. Free accounts may have lower stability and are suitable for testing purposes. If you plan to use it officially in the future, it is recommended to buy a VPN account to use. Most free VPNs will limit the connection time, and the problem of timed disconnections is very annoying.
3. After obtaining the router and VPN account, we will officially set up the DD-WRT VPN connection. Below, we will provide a detailed explanation along with screenshots.
4. Firstly, log in to the router settings page and access it through the browser http://192.168.1.1/ It can be opened. After logging in, click on "Services" - "VPN" in sequence, and then fill in the VPN connection options, as shown in the example below. Be careful not to activate the DMZ service.
Select 'Disable' for PPTP server
Select 'Enable' for PPTP client
Fill in the server IP or DNS name with "VPN line address (provided by VPN service provider)"
Fill in the "VPN network segment" for the remote subnet (first dial up to connect to the VPN to check the connection status, click on "Details", fill in the first two digits of the IPv4 address, and fill in 0.0 for the last two digits)
The remote subnet mask is usually filled with "255.255.255.0", which can also be viewed in VPN dial-up connections. The first three sets of numbers are written as 255, and the last set is written as 0
MPPE encryption requires "mppe required, no40, no56, stateless"
MTU and MRU can generally be kept at default values. If the VPN connection cannot access the internet, the MTU can be set smaller
NAT option 'Start'
Fill in the username and password as "VPN account (provided by VPN service provider)"
5. After completing the above settings, click save. Open "Management" - "Command" again, enter "reboot", click the run command, and the router will be restarted.
6. After restarting, log in to the router using telnet to check if the PPTP VPN connection is successful. Note: Windows systems above Vista do not have Telnet support enabled by default. You need to go to Control Panel - Programs and Features - Turn on or off Windows features on the left - Check "Telnet client" in the component addition window to install.
Telnet login router method: Use the Windows+R key combination to open "Run" - enter cmd and click OK - enter telnet 192.168.1.1 in the command line window and press enter, then enter the root username and password to log in. After logging in, enter the ps | grep pptp command to check the PPTP process. As shown in the figure below, the connection is successful. If it is not successful, return to the previous step to check if the settings are correct and if the VPN account line is available.
2、 Customize VPN access diversion rules
If you need to customize a specific website to use VPN access, you can use DNSMasq to redirect access. The specific method is as follows:
1. Run the route command in telnet to check the routing table status. The VPN gateway address shown in the following figure is 10.88.10.1.
2. After obtaining the VPN gateway address, configure the gateway and enter the command to run IP route add 100.0.0.0 via 10.88.10.1 (modify it according to your VPN gateway address and run it). This command means to use the VPN gateway at 100.0.0.0.
3. Set up DNSMasq diversion rules, log in to the router settings page in the browser, click on "Services" - "Services", enable DNSMasq, disable local DNS, enable No DNS Rebind, and then add the DNSMasq add-on option. For example, if we need to set up VPN networks for YouTube, Facebook, and Google websites, enter the following content and click save.
no-resolv
no-poll
server=114.114.114.114
server=114.114.115.115
address=/youtube.com/100.0.0.0
address=/facebook.com/100.0.0.0
address=/google.com/100.0.0.0
4. Next, set up VPN startup. Under "Management" - "Commands", enter the following code:
sleep 35
echo “#!/bin/sh” > /tmp/pptpd_client/checkvpn
echo “while [ 1 ]” >> /tmp/pptpd_client/checkvpn
echo “do” >> /tmp/pptpd_client/checkvpn
echo “ip route add 100.0.0.0 via 10.88.10.1″ >> /tmp/pptpd_client/checkvpn
echo “sleep 10″ >> /tmp/pptpd_client/checkvpn
echo “done” >> /tmp/pptpd_client/checkvpn
chmod 755 /tmp/pptpd_client/checkvpn
sh /tmp/pptpd_client/checkvpn &
Modify the sentence echo "IP route add 100.0.0.0 via 10.88.10.1">>/tmp/pptpd_client/checkVPN in the above command according to your own situation. Change 10.88.10.1 to your VPN gateway address.
5. After setting up, click "Save as Startup Command", and then enter the reboot command to run the router restart. That concludes the setup.
| High-speed VPN | Fast VPN | Preferred Accelerator VPN | Reliable VPN |
| High quality VPN | Old fashioned VPN | Stable VPN(Recommend) | Smooth VPN |

