From 9b100deefff0a0fa8e06fd371102881ee23509c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 16 Aug 2016 00:54:54 +0200 Subject: [PATCH] Android --- ImmaeEu-down | 6 +++++- ImmaeEu-up | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ImmaeEu-down b/ImmaeEu-down index 657b83f..8a0ef22 100644 --- a/ImmaeEu-down +++ b/ImmaeEu-down @@ -4,9 +4,13 @@ source /sdcard/.tinc/vars rm /sdcard/.tinc/vars -ip -6 route del default via $GWIP +ip -6 rule del from all lookup 100 +ip route del table 100 $REMOTEADDRESS +ip -6 route del table 100 $GWIP dev vpn6 +ip -6 route del table 100 ::/1 via $GWIP dev vpn6 for MYIP in $MYIPS; do ip -6 addr del $MYIP/96 dev vpn6 done ip -6 link set vpn6 down + diff --git a/ImmaeEu-up b/ImmaeEu-up index 95004f3..f57c2e3 100644 --- a/ImmaeEu-up +++ b/ImmaeEu-up @@ -10,4 +10,9 @@ ip -6 link set vpn6 up mtu 1280 for MYIP in $MYIPS; do ip -6 addr add $MYIP/96 dev vpn6 done -ip -6 route add default via $GWIP +ORIGINAL_GATEWAY=$(for a in $(ip rule show | grep lookup | sed -r 's/.* lookup ([^ ]+).*/\1/'); do ip route show table $a | grep ^default | cut -d ' ' -f 2-5; done | head -1) + +ip -6 rule add prio 100 from all lookup 100 +ip route add table 100 $REMOTEADDRESS $ORIGINAL_GATEWAY +ip -6 route add table 100 $GWIP dev vpn6 +ip -6 route add table 100 ::/1 via $GWIP dev vpn6 -- 2.41.0