Jump to content
TorGuard
  • 0

Easy DDWRT Script

Rate this question


TorGuard Admin

Question

TorGuard Admin

We just released a new DD-WRT command scripts that allow for easy access to all of our anonymous vpn servers. Checkout the link below for details:

 

http://torguard.net/knowledgebase.php?action=displayarticle&id=47

 

Just add your username and password to the startup script and that's it!

 

Let us know if you have any questions.

Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

From a telnet command prompt, where H_IP is a VPN-less IP and your ISP's gateway is GW_IP.

 

Syntax Example: (single IP)

 

route add -net H_IP netmask 255.255.255.255 gw GW_IP metric 1

 

So, if I want bing.com to NOT use the vpn connection, since bing.com is 204.79.197.200, and my cable modem's gateway IP is 192.168.0.1, then

 

route add -net 204.79.197.200 netmask 255.255.255.255 gw 192.168.0.1 metric 1

 

note: this can be added at any point in the startup script or later, either before or after a VPN connection is made. Personally I use this for a number of websites each time my router boots. Some websites, torguard.net for example, get a little hinky if your IP keeps changing. I get tired of logging in all the time... Also, sites like bing.com try to localize content, which is also a tad confusing now and then...

 

Syntax Example: (subnet)

 

If I wanted to do the same for Microsoft's class C subnet . . .

 

route add -net 204.79.197.0 netmask 255.255.255.0 gw 192.168.0.1 metric 1

 

While I would not recommend doing this on a subnet basis, it could be useful if you have a site that is using a server farm and DNS is providing different IPs each time to resolve the host IP. OR, if you wanted to make all of Google's subnets direct. Although, I personally block all of Google's subnets. They are collecting too much information as it is...

 

 

 

Link to post
Share on other sites
  • 0
Jarret Aubry

I've tried to set this up using the guide at: http://torguard.net/knowledgebase.php?action=displayarticle&id=47

 

However I can't seem to get this working. My DD-WRT admin panel looks quite a bit different so I'm not certain I'm doing this correctly.

 

The guide shows screenshots from 2010 and 2011. My firmware is DD-WRT v24-sp2 (02/19/14) mega, and I've posted a screenshot of my admin panel (altered username and password).

 

ddwrt.png

Link to post
Share on other sites
  • 0
Jarret Aubry

Forgot to add I'm using the following config script in the "Additional Config" area as downloaded from TorGuard:

 

#!/bin/sh

 

USERNAME="USERNAME-HERE"

PASSWORD="PASSWORD-HERE"

 

PROTOCOL="tcp"

# Add - delete - edit servers between ##BB## and ##EE##

REMOTE_SERVERS="

##BB##

# USADallas

remote-random

remote 96.44.142.186 443

remote 96.44.142.242 443

remote 96.44.142.178 443

remote 96.44.147.114 443

remote 96.44.143.234 443

remote 96.44.146.106 443

remote 96.44.147.34 443

remote 96.44.147.122 443

remote 96.44.147.138 443

remote 96.44.145.106 443

remote 96.44.146.154 443

##EE##

"

 

#### DO NOT CHANGE below this line unless you know exactly what you're doing ####

 

CA_CRT='-----BEGIN CERTIFICATE-----

MIIDqzCCAxSgAwIBAgIJAP/g7Ah3SNNHMA0GCSqGSIb3DQEBBQUAMIGWMQswCQYD

VQQGEwJVUzELMAkGA1UECBMCRkwxEDAOBgNVBAcTB09ybGFuZG8xETAPBgNVBAoT

CFRvckd1YXJkMQwwCgYDVQQLEwNWUE4xEzARBgNVBAMTClRHLU9WUE4tQ0ExDDAK

BgNVBCkTA1ZQTjEkMCIGCSqGSIb3DQEJARYVc3lzYWRtaW5AdG9yZ3VhcmQubmV0

MB4XDTE0MDQwOTE0NDIyMloXDTI0MDQwNjE0NDIyMlowgZYxCzAJBgNVBAYTAlVT

MQswCQYDVQQIEwJGTDEQMA4GA1UEBxMHT3JsYW5kbzERMA8GA1UEChMIVG9yR3Vh

cmQxDDAKBgNVBAsTA1ZQTjETMBEGA1UEAxMKVEctT1ZQTi1DQTEMMAoGA1UEKRMD

VlBOMSQwIgYJKoZIhvcNAQkBFhVzeXNhZG1pbkB0b3JndWFyZC5uZXQwgZ8wDQYJ

KoZIhvcNAQEBBQADgY0AMIGJAoGBANeCV65/6z6cbGfZ6LouGl1W7A71x6CEerxN

wcFeLZx89DM0NxEBs47+gYYqhzKCR+6YCVduD29NMa5dzDwNFEmhOKrHhIposdY7

JmNC2IeXxOSEcOMjBrRexqBN+CZx0bfj6H6qtlRFtkZlDvNritINiznJjG/DbA2X

jTO6J8f1AgMBAAGjgf4wgfswHQYDVR0OBBYEFPWAX1TtNU8tPbhRdYMGn98i9Hoi

MIHLBgNVHSMEgcMwgcCAFPWAX1TtNU8tPbhRdYMGn98i9HoioYGcpIGZMIGWMQsw

CQYDVQQGEwJVUzELMAkGA1UECBMCRkwxEDAOBgNVBAcTB09ybGFuZG8xETAPBgNV

BAoTCFRvckd1YXJkMQwwCgYDVQQLEwNWUE4xEzARBgNVBAMTClRHLU9WUE4tQ0Ex

DDAKBgNVBCkTA1ZQTjEkMCIGCSqGSIb3DQEJARYVc3lzYWRtaW5AdG9yZ3VhcmQu

bmV0ggkA/+DsCHdI00cwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBx

1VNcpbpAPzSz8gfT7iUiVPsSgHqhrzozEY8zpPoZkHDfo75P6AQnGwGdDHKljo6h

dkl1ZCTMd0CMbQbWzseNIZNwvHbE3hcnH0zxVKaGyNB6FNdhWVDNcvOhIZYvYbPM

fzWZQFXS/jfjjn1+p9UUQwPONvhoQaRhsUJOcrntug==

-----END CERTIFICATE-----'

 

OPVPNENABLE=`nvram get openvpncl_enable | awk '$1 == "0" {print $1}'`

 

if [ "$OPVPNENABLE" != 0 ]; then

nvram set openvpncl_enable=0

nvram commit

fi

 

sleep 10

mkdir /tmp/torguard; cd /tmp/torguard

echo -e "$USERNAMEn$PASSWORD" > userpass.conf

echo "$CA_CRT" > ca.crt

echo "#!/bin/sh

iptables -t nat -I POSTROUTING -o tun0 -j MASQUERADE" > route-up.sh

echo "#!/bin/sh

iptables -t nat -D POSTROUTING -o tun0 -j MASQUERADE" > route-down.sh

chmod 644 ca.crt; chmod 600 userpass.conf; chmod 700 route-up.sh route-down.sh

sleep 10

echo "client

auth-user-pass /tmp/torguard/userpass.conf

management 127.0.0.1 5001

management-log-cache 50

dev tun0

proto $PROTOCOL

comp-lzo adaptive

fast-io

script-security 2

mtu-disc yes

verb 4

mute 5

cipher bf-cbc

auth sha1

tun-mtu 1500

resolv-retry infinite

nobind

persist-key

persist-tun

tls-client

remote-cert-tls server

log-append torguard.log

ca ca.crt

status-version 3

status status

daemon

$REMOTE_SERVERS" > torguard.conf

ln -s /tmp/torguard/torguard.log /tmp/torguard.log

ln -s /tmp/torguard/status /tmp/status

(killall openvpn; openvpn --config /tmp/torguard/torguard.conf --route-up /tmp/torguard/route-up.sh --down /tmp/torguard/route-down.sh) &

exit

 

Link to post
Share on other sites
  • 0
Support

Hi James

 

This script should actually be added under the commands section.

 

Administration >> Commands, enter script and hit save-startup then reboot.

 

Regards

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...