Add ctl for mud_add_path() and mud_del_path()

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët
2018-01-26 19:52:16 +00:00
parent 0169a09469
commit 567e5d0193
5 changed files with 68 additions and 18 deletions

View File

@@ -51,8 +51,9 @@ PREF=32765
TABLE=200
# keep the current route to HOST
src=$(ip route get "$HOST" | awk '/src/{getline;print $0}' RS=' ')
ip rule add from "$src" table main pref "$((PREF-1))" || true
SRC=$(ip route get "$HOST" | awk '/src/{getline;print $0}' RS=' ')
ip rule add from "$SRC" table main pref "$((PREF-1))" || true
glorytunctl path add "$SRC" dev "$DEV"
# forward everything else to the tunnel
ip rule add from all table "$TABLE" pref "$PREF" || true