Posted: Tue Aug 01, 2017 18:55 Post subject: Bypass VPN for one address to a SOCKS 5 Proxy?
Hi, been searching for an answer to my problem which seems quite simple in theory but I'm a novice at networking.
I have OpenVPN set up with most traffic going through that apart from selected devices(firewall script), this is working but for one particular server which needs lower latency so performance isn't reliable enough for this purpose.
I have found a startup script that will exclude selected addresses and route them through my WAN IP(ISP) but I want to tailor this script to send the selected addresses over a SOCKS 5 Proxy instead.
# dd-wrt selective domain routing
WAN_GW="$(nvram get wan_gateway)"
# list domains for selective routing
for domain in \
"netflix.com" \
"ichnaea.netflix.com" \
"movies.netflix.com" \
"www.netflix.com" \
"nflxext.com" \
"cdn1.nflxext.com" \
"nflximg.com" \
"nflxvideo.net" \
"ipv4_1.cxl0.c145.sjc002.ix.nflxvideo.net"
do
# extract ip addresses
for ip in $(nslookup $domain | awk '/^Name:/,0{if (/^Addr/)print $3}'); do
# add class c route for each ip address to wan gateway
ip route add `echo $ip | cut -d . -f 1,2`.0.0/16 via $WAN_GW
done
done
# flush cache
ip route flush cache
EOF
chmod +x $SCRIPT
sleep 60
$SCRIPT
I'm guessing the part I've highlighted in bold is the part I need to change, do I just change the part that says "via $WAN_GW" to a SOCKS 5 address? If I'm using my VPN providers SOCKS 5 address I'd need to authenticate the connection somewhere too wouldn't I?
# dd-wrt selective domain routing
WAN_GW="$(nvram get wan_gateway)"
# list domains for selective routing
for domain in \
"whatsmyip.org" \
"iptvserver.com"
do
# extract ip addresses
for ip in $(nslookup $domain | awk '/^Name:/,0{if (/^Addr/)print $3}'); do
# add class c route for each ip address to wan gateway
ip route add `echo $ip | cut -d . -f 1,2`.0.0/16 via uk104.nordvpn.com 1080 userpass.txt
done
done
# flush cache
ip route flush cache
EOF
chmod +x $SCRIPT
sleep 60
$SCRIPT
Any ideas how I can authenticate to allow me to connect?