HideMyAss VPN

Monday, April 29, 2013

Bypassing VPN on per IP basis DD-WRT

Once a router is connected to HMA OpenVPN every device using that connection goes through the tunnel. If you want to filter devices to connect via the ISP's IP address, do this:

Transient solution

A- Go to ADMINISTRATION - COMMANDS - COMMAND SHELL and get the value of wan_gateway running this command: nvram get wan_gateway
B- Run a couple more commands:
ip route add default via (what you got in A) table 10 e. g. ip route add default via 173.234.216.1 table 10
ip rule add from (IP address you want to filter) table 10 e. g. ip rule add from 192.168.1.10 table 10

Permanent solution that survives reboots

1. Do the 4 Easy Steps Tutorial (http://forum.hidemya...ial/#entry16142) or run the HMA auto-installer (http://wiki.hidemyas...WRT_and_OpenWRT)

2. Go to ADMINISTRATION - COMMANDS - COMMAND SHELL and create a nvram variable wich will contain a list of the IP Addresses you want to filter, like this:

nvram set no_vpn_lst="192.168.1.11 192.168.1.12 192.168.1.13 "
nvram commit

As you can see, there's a space between every IP address, and a final space before the closing quotation mark. Customize the list to match the IP addresses you want to filter taking care of using the aforementioned spaces.

3. Download a script from http://pastebin.com/....php?i=nttcdVX3

4. Copy the script contents, paste to COMMANDS - COMMAND SHELL and click Save Custom Script



5. Reboot

6. That's it. Now the devices on your list will be routed outside the OpenVPN tunnel.

To set up static IP addresses these links tell you how (IT IS SAFE TO SKIP PORT FORWARDING SECTION, IT IS NOT NECESSARY, UNLESS YOU NEED IT OF COURSE).

http://www.dd-wrt.co...php/Static_DHCP

http://www.howtogeek...-dd-wrt-router/

No comments:

Post a Comment