In the first case statement, change the 192.168.x entry to the first three octets of your remote network. In this instance, the remote IP is 192.168.3.1, and the remote network is 192.168.30.0/24 (the remote VPN box is doing the routing -- this is so SAMBA will work without needing to proxy ARP).

Uncomment (remove the ##'s) from the debug lines to see what this script is doing. Output will be written to the /tmp/ip-up-debug.txt file. Remember to put the ##'s back in when you are done testing.

This script has options for three different VPN connections. Just change the 192.168.x entries to the different network addresses of your different VPNs.

[robg adds: The first part of this hint is a duplicate, but I believe the second part is new, so I chose to run it as is...]

So now that this ability of choices has been implemented. It brings an issue to the table. In my case I go do different clients. Sometimes they use the same network address 192.168.1.x. It would be interesting to be able to have a full setup of routes, but have the script perform a reverse DNS lookup. Based on that lookup, it would filter out given routes to add. Talk about an intelligent VPN Tunnel tool!!