Skip to content

Instantly share code, notes, and snippets.

@tomaszkubacki
Created September 4, 2022 08:29
Show Gist options
  • Save tomaszkubacki/f6456ab287a495dc0baf56e6bd9c897b to your computer and use it in GitHub Desktop.
Save tomaszkubacki/f6456ab287a495dc0baf56e6bd9c897b to your computer and use it in GitHub Desktop.
fortivpn config to add routes on start
#!/bin/sh -e
# create executable file at /etc/ppp/ip-up.d/openfortivpn (any name is allow ed, but do not end with .sh)
# pass routes to add via pppd-ipparam
# eg. put this into your openfortivpn config file:
# set-routes=0
# pppd-ipparam=192.168.77.209 192.168.77.233 192.168.77.205
logger "forticlient connection is up $PPP_IFACE connection ip routes: ${6}"
IPS="${6}"
for IP in ${IPS}
do
ip route add ${IP} dev $PPP_IFACE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment