Setting up DD-WRT OpenVPN client.
I've read many users have trouble setting up the OpenVPN client on some DD-WRT flashed routers. There are DD-WRT builds that lack the ADVANCED OPTIONS button, here's my solution:
1- Go to SETUP - BASIC SETUP - NETWORK ADDRESS SERVER SETTINGS (DHCP)
Set Static DNS 1 to: 8.8.8.8
Set Static DNS 2 to: 8.8.4.4
or any other DNS servers you want.
2- Set TIME SETTINGS to match your current location.
Click SAVE - Click APPLY SETTINGS
3- Go to SERVICES - VPN
Enable OpenVPN Server (Just click the enable button, do nothing else). This step you can skip. It only serves the purpose of enabling OPENVPN STATUS so that you can see the current state and log of PIA OPENVPN CLIENT.
Click APPLY SETTINGS
4- Go to ADMINISTRATION - COMMANDS
Copy - Paste the text from link below to commands, don't forget to edit Your_PIA_Username and Your_PIA_Password with your own credentials, if you want you can change the remote regional-gateway (us-west...) too:
Click SAVE STARTUP
5- Go to ADMINISTRATION - MANAGEMENT
Click REBOOT ROUTER
6- That should do it, from now on every device that gets a IP address from your router will go through PIA's VPN tunnel.
As you can see, we did nothing to the OpenVPN client in SERVICES - VPN. The script takes care of that for us.
ENJOY!!
Comments
p999999 I need your help if you can I did as you said in your post setting up dd-wrt router but it shows my real ip address. I have TeamViewer on my pc if you have Teamviewer we can connect together and you can see my setup.Maybe you can look at it and tweak it to work.
I have one question:
In your script I can see, where you setup routing through tun device:
iptables -t nat -I POSTROUTING -o tun0 -j MASQUERADE" > route-up.sh
iptables -t nat -D POSTROUTING -o tun0 -j MASQUERADE" > route-down.sh
I`ve created a bridge br1 for my second guest WiFi network 192.168.2.X .
So I have two bridges. Default br0 and br1.
How can I modify the rules to VPN`ize only the traffic from that guest network on br1?
Processing VPN from all networks overheads my router CPU. I just wanted to install VPN clients for pcs on my home network and VPN`ize small guest traffic on router.
Thank`s in advance!
Step 1; DNS set for OpenDNS
Step 2; Time settings set to -8 GMT, NTP server selected
Step 3; Start OpenVPN Daemon set to 'yes'
Step 4; Username/Password added, no servers changed, copied and pasted using Notepad++, clicked 'Save Startup'
Step 5; Clicked reboot router, also have tried power cycling
Step 6; Doesn't work.
I can see an OpenVPN section under Status tab now, but the State, Status and Log sections under that tab are all blank. This setup has been done on a mostly fresh flash (apart from wireless config). I've tried with and without SPI firewall enabled.
I'm not sure where to go from here. Open to any suggestions.
I don't have any experience with DD-WRT, but maybe try without the OpenVPN daemon.
I have D-Link DIR-615 router and am using Firmware: DD-WRT v24-sp2 (03/25/13) std Build 20161. I was trying different vpn setting available on PIA website. When I saw this post I rest setting to start a fresh.
I changed static DNS as noted above and copied command and pasted into the comman box. I changed user name and password (same as to access PIA) and followed rest of the instructions. But I don't see this works for me. Is there anything I should do to make it work?
There is one minor trick to doing this - make sure the subnets do not conflict. We made the subnet mask of the main router 255.255.255.128 and the subnet mask of the tomato router 255.255.255.0. I configured the main router to assign IP's in the range 192.168.50.1 to 100 while the tomato to assign IP's in the range 150 to 250. The subnet mask on all of the computers matches the tomato so they can connect to either one.
** edit - corrected stupid mistake... **
No, both routers can be set as DHCP so it is not necessary to make your computer IP addresses static. Sorry for the confusion, my situation is a little different.
Just make sure that your routers each have distinct subnets so they don't conflict. I do have a static IP address in one of my computers because I use Synergy to connect my desktop to my laptop so I they can share a mouse/keyboard. Synergy requires a static IP. I have since changed the configuration so that the computer's IP address is set static in each router rather than in the computer settings, much better. This situation probably does not apply to you anyway (unless you want to use Synergy - it is a cool little program).
You can just make both masks 255.255.255.0 but have the main router as i.e.
10.45.90.1/24
and the second router can be i.e.
192.168.123.1/24
It really does not matter what the router IP's are - as long as the subnets are different.
I'm using DD-WRT v24-sp2 mini on Linksys WRT160Nv3.
Is there any other settings needed to be changed from default other that what is listed in op's post?
Any suggestions?
Thanks.