routing tables - for hulu and pandora - via vpn on router

routing tables - for hulu and pandora - via vpn on router

Author
Discussion

spants

Original Poster:

1,056 posts

228 months

Monday 21st February 2011
quotequote all
I'm using ddwrt firmware on my router and would like to set up a static route for stuff that needs a USA ip. I have vyper vpn working well but this tunnels all my traffic via the vpn and slows it all down. I dont do anything dodgy so I'm not worried about the vpn for my traffic.

I need help with the router commands (the syntax) to set up a route.
This is what I have at the moment:

#!/bin/sh
sleep 120
PPTPSERVER=$(/usr/sbin/nvram get pptpd_client_srvip)
PPTPGWY=$(/usr/sbin/nvram get wan_gateway)
/sbin/route add -host $PPTPSERVER gw $PPTPGWY dev vlan2
/sbin/route del default
/sbin/route add default gw $PPTPGWY
#Hulu
/sbin/route add 8.15.0.0/16 dev ppp0
/sbin/route add 69.31.0.0/16 dev ppp0
#Pandora
/sbin/route add 208.85.0.0/16 dev ppp0
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE


... the problem is that the traffic does not go across the vpn.

>Should the "route add" commands end in "dev van2"?
>Should the "route add default" lines look like this:


/sbin/route add default dev ppp0 metric 100
/sbin/route add default gw $PPTPGWY


Any ideas?

cheers
Spants

spants

Original Poster:

1,056 posts

228 months

Tuesday 22nd February 2011
quotequote all
answering my own question... and documented in case anyone else wants it!

for my dd-wrt router, this allows me to watch hulu and listen to pandora over the vpn without routing all my traffic....



#!/bin/sh
sleep 60
PPTPSERVER=$(/usr/sbin/nvram get pptpd_client_srvip)
PPTPGWY=$(/usr/sbin/nvram get wan_gateway)
/sbin/route add -host $PPTPSERVER gw $PPTPGWY dev vlan2
/sbin/route del default
/sbin/route add default gw $PPTPGWY
/sbin/route add default dev ppp0 metric 100
#Hulu
/sbin/route add -net 8.15.0.0/16 dev ppp0
/sbin/route add -net 69.31.0.0/16 dev ppp0
/sbin/route add -net 24.143.0.0/16 dev ppp0
/sbin/route add -net 24.29.0.0/16 dev ppp0
/sbin/route add -net 8.12.221.0/24 dev ppp0
/sbin/route add -net 64.0.0.0/8 dev ppp0
/sbin/route add -net 62.0.0.0/8 dev ppp0
/sbin/route add -net 72.0.0.0/8 dev ppp0
/sbin/route add -net 74.0.0.0/8 dev ppp0
/sbin/route add -net 80.67.74.0/24 dev ppp0
/sbin/route add -net 92.123.73.0/24 dev ppp0
/sbin/route add -net 96.17.144.0/24 dev ppp0
/sbin/route add -net 128.241.220.0/24 dev ppp0
/sbin/route add -net 138.108.59.0/24 dev ppp0
/sbin/route add -net 184.51.181.0/24 dev ppp0
/sbin/route add -net 194.65.5.0/24 dev ppp0
/sbin/route add -net 198.105.194.0/24 dev ppp0
/sbin/route add -net 208.91.157.0/24 dev ppp0
/sbin/route add -net 209.130.205.0/24 dev ppp0
/sbin/route add -net 216.223.0.0/24 dev ppp0

#Pandora
/sbin/route add -net 208.85.0.0/16 dev ppp0
/sbin/route add -net 64.95.61.0/24 dev ppp0
/sbin/route add -net 64.94.123.0/24 dev ppp0
/sbin/route add -net 208.85.40.0/24 dev ppp0
/sbin/route add -net 208.85.41.0/24 dev ppp0
/sbin/route add -net 67.225.0.0/24 dev ppp0

#iptables -t nat -A PREROUTING -p tcp -–dport 1935 -j DROP
#iptables -t nat -A PREROUTING -p udp -–dport 1935 -j DROP

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE