Here's the script I'm running. It's retarded and Asustor should fix the routing for vpn clients like Synology does. Anyhow, this should work if you can bind download station to a specific IP (like transmissions ipv4-bind-address) otherwise, use transmission.
To get the trusted ip run ip route in the terminal and take note of the new route with your vpn ip. To get ifconfig_local look for inet addr: under the ppp255 interface (run ifconfig). route_net_gateway is your routers ip (192.168.x.1 something). You will also need to add
- Code: Select all
200 vpn
to the end of
- Code: Select all
/etc/iproute2/rt_tables
.
It's absolutely ridiculous that you have to do this manually, but that's what I come to expect from Asustor... Nothing's working on this damn nas. Sure, it's cheap and fast but the software. OMG.
- Code: Select all
IP=/sbin/ip
ETH=eth0
TUN=ppp255
ifconfig_local=10.100.0.4
ifconfig_remote=10.100.0.1
trusted_ip=x.x.x.x
route_net_gateway=192.168.2.1
$IP route flush table vpn
$IP rule del from all to $ifconfig_local lookup vpn
$IP rule del from $ifconfig_local lookup vpn
$IP route add $trusted_ip via $route_net_gateway dev $ETH
$IP route add 10.100.0.0/1 via $ifconfig_remote dev $TUN
$IP route add 0.0.0.0/1 via $ifconfig_remote dev $TUN table vpn
$IP rule add from all to $ifconfig_local lookup vpn
$IP rule add from $ifconfig_local lookup vpn
$IP rule add from all to $ifconfig_remote lookup vpn
$IP rule add from $ifconfig_remote lookup vpn