-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add --pppd-call option. On systems where pppd supports the "call" option --- eg. Debian derived distros --- privileged options to pppd can be moved to a config file owned by root, and any unprivileged user in group "dip" can invoke openfortivpn. Static routes and DNS settings are managed by /etc/ppp/ip-up.local and /etc/ppp/ip-down.local scripts, provided the following lines are added to /etc/openfortivpn/config: set-routes = 0 set-dns = 0 pppd-ipparam = openfortivpn pppd-call = openfortivpn
- Loading branch information
1 parent
25b2585
commit a2dfcb6
Showing
9 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
case "$PPP_IPPARAM" in | ||
openfortivpn*) | ||
rconf=/etc/resolv.conf | ||
[[ -f $rconf.openfortivpn ]] && cp -pv $rconf.openfortivpn $rconf | ||
exit 0 | ||
;; | ||
esac 2>&1 | logger -p daemon.debug -i -t "$0" | ||
|
||
true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
case "$PPP_IPPARAM" in | ||
openfortivpn*) | ||
rconf=/etc/resolv.conf | ||
routes=$(echo $PPP_IPPARAM | tr , ' ') | ||
for r in $routes; do | ||
[[ $r = "openfortivpn" ]] && continue | ||
com="ip route add ${r%/*} via ${r##*/}" | ||
echo $com | ||
$com | ||
done | ||
cp -pv $rconf $rconf.openfortivpn | ||
if [[ "$DNS1" ]]; then | ||
echo nameserver $DNS1 > $rconf | ||
[[ "$DNS2" ]] && [[ "$DNS1" != "$DNS2" ]] && echo nameserver $DNS2 >> $rconf | ||
fi | ||
exit 0 | ||
;; | ||
esac 2>&1 | logger -p daemon.debug -i -t "$0" | ||
|
||
true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
38400 | ||
:1.1.1.1 | ||
noipdefault | ||
noaccomp | ||
noauth | ||
default-asyncmap | ||
nopcomp | ||
receive-all | ||
nodefaultroute | ||
nodetach | ||
lcp-max-configure 40 | ||
mru 1354 |
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
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
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
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
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