Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Routing Script in Wiki #669

Closed
obel1x opened this issue Apr 23, 2020 · 2 comments
Closed

Update Routing Script in Wiki #669

obel1x opened this issue Apr 23, 2020 · 2 comments

Comments

@obel1x
Copy link

obel1x commented Apr 23, 2020

Hey, i had the same needs as #614 and found the solution in #371 and your wiki.
There is a small bug, which causes the script described there to not work any more, because "route" has now been replaced by "ip route".

I would like to update the chapter "using pppd ip-up / ip-down scripts" like this:

#!/bin/bash
#
# Whitelist here all domains that need to go through FortiVPN
# Domains are separated by a space
domains='example.com example.fr'
ips='10.0.0.0/8'

BASENAME=${0##*/}
INTERFACE=$1
DEVICE=$2
SPEED=$3
LOCALIP=$4
REMOTEIP=$5
IPPARAM=$6
ACTION=${0#/etc/ppp/}

let resolved
for domain in $domains; do
  resolved=`dig +short $domain | tail -n1`
  ips="$ips $resolved"
done

for ip in $ips; do
  ip route add $ip dev $INTERFACE
done

Should i just do it, or are there any hints?

@mrbaseman
Copy link
Collaborator

looks good.

  • the positional parameters $1 ... $6 are included in the new version
  • the correct interface is set for the routes
  • ip route is used as more and more distributions change towards the ip command

@obel1x
Copy link
Author

obel1x commented Apr 28, 2020

thanks for the review. I now did the changes and added hopefully a few helpful descriptions.

If thats ok, i would close this and maybe take care of the issues above to close them.

@obel1x obel1x closed this as completed May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants