diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-08-16 00:54:54 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-08-16 00:54:54 +0200 |
commit | 9b100deefff0a0fa8e06fd371102881ee23509c5 (patch) | |
tree | e63fed0049d3f847e60cfa6ce81115fbd14ff6fc | |
parent | 338a604b137012c6455679a7b46adc46c793341d (diff) | |
download | hosts-9b100deefff0a0fa8e06fd371102881ee23509c5.tar.gz hosts-9b100deefff0a0fa8e06fd371102881ee23509c5.tar.zst hosts-9b100deefff0a0fa8e06fd371102881ee23509c5.zip |
Android
-rw-r--r-- | ImmaeEu-down | 6 | ||||
-rw-r--r-- | 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 @@ | |||
4 | source /sdcard/.tinc/vars | 4 | source /sdcard/.tinc/vars |
5 | rm /sdcard/.tinc/vars | 5 | rm /sdcard/.tinc/vars |
6 | 6 | ||
7 | ip -6 route del default via $GWIP | 7 | ip -6 rule del from all lookup 100 |
8 | ip route del table 100 $REMOTEADDRESS | ||
9 | ip -6 route del table 100 $GWIP dev vpn6 | ||
10 | ip -6 route del table 100 ::/1 via $GWIP dev vpn6 | ||
8 | for MYIP in $MYIPS; do | 11 | for MYIP in $MYIPS; do |
9 | ip -6 addr del $MYIP/96 dev vpn6 | 12 | ip -6 addr del $MYIP/96 dev vpn6 |
10 | done | 13 | done |
11 | ip -6 link set vpn6 down | 14 | ip -6 link set vpn6 down |
12 | 15 | ||
16 | |||
@@ -10,4 +10,9 @@ ip -6 link set vpn6 up mtu 1280 | |||
10 | for MYIP in $MYIPS; do | 10 | for MYIP in $MYIPS; do |
11 | ip -6 addr add $MYIP/96 dev vpn6 | 11 | ip -6 addr add $MYIP/96 dev vpn6 |
12 | done | 12 | done |
13 | ip -6 route add default via $GWIP | 13 | 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) |
14 | |||
15 | ip -6 rule add prio 100 from all lookup 100 | ||
16 | ip route add table 100 $REMOTEADDRESS $ORIGINAL_GATEWAY | ||
17 | ip -6 route add table 100 $GWIP dev vpn6 | ||
18 | ip -6 route add table 100 ::/1 via $GWIP dev vpn6 | ||