Created
September 4, 2022 08:29
-
-
Save tomaszkubacki/f6456ab287a495dc0baf56e6bd9c897b to your computer and use it in GitHub Desktop.
fortivpn config to add routes on start
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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