I have TomatoVPN runing with blackVPN and I'd like to achieve something like this if it's even possible to do it on TomatoVPN. I've come up with this but it doesn't work... nothing works after this script starts...
#!/bin/sh
# get current default gateway
DEFAULT_GW=`ip route show | awk '$1 == "default" && $2 == "via" {print $3}'`
# get WAN gateway
GW=`nvram get wan_gateway`
# IP address of VPN gateway
VPN_GW=`ip route show | awk '$2 == "dev" && $3 == "tun11" && $4 == "proto" {print $1}'`
# List of IPs to reroute
IP="212.58.241.131"
ip route add $IP via $VPN_GW
logger "Routing $IP via VPN gateway $VPN_GW"
# route normal traffic thru WAN gateway
ip route del default
ip route add default via $DEFAULT_GW
ip route flush cache