1
0

vpnc-route 984 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. #* VPNGATEWAY -- vpn gateway address (always present)
  3. #* TUNDEV -- tunnel device (always present)
  4. #* INTERNAL_IP4_ADDRESS -- address (always present)
  5. # define which traffic should be routed through the tunnel device
  6. # any traffic that is not bound to a local interface will be
  7. # mangled by the "main" routing table, so we add our rules to
  8. # the main routing table
  9. # the setup for remote traffic and already bound traffic is done by
  10. # the hotplug scripts.
  11. if [ "x$TUNDEV" == "x" ]; then
  12. echo "No TUNDEV given. Script must be called from vpnc-script"
  13. exit 1;
  14. fi
  15. case "$1" in
  16. start)
  17. # for each subnet that should be reached from this machine over the vpn tunnel,
  18. # add a line like this:
  19. # ip route add some.sub.net/msk dev $TUNDEV src $INTERNAL_IP4_ADDRESS
  20. ;;
  21. stop)
  22. # remove the routing entries
  23. ;;
  24. esac;
  25. exit 0;