summaryrefslogtreecommitdiff
path: root/ImmaeEu-up
diff options
context:
space:
mode:
Diffstat (limited to 'ImmaeEu-up')
-rwxr-xr-xImmaeEu-up23
1 files changed, 23 insertions, 0 deletions
diff --git a/ImmaeEu-up b/ImmaeEu-up
new file mode 100755
index 0000000..00eb60f
--- /dev/null
+++ b/ImmaeEu-up
@@ -0,0 +1,23 @@
1#!/bin/sh
2# This file sets up the tap device.
3# It gives you the freedom to do anything you want with it.
4# Use the correct name for the tap device:
5# The environment variable $INTERFACE is set to the right name
6# on most platforms, but if it doesn't work try to set it manually.
7
8# Give it the right ip and netmask. Remember, the subnet of the
9# tap device must be larger than that of the individual Subnets
10# as defined in the host configuration file!
11SUBDOMAIN=`cat /etc/tinc/$NETNAME/tinc_domaine`
12while [ -z "$MYIPS" -o -z "$GWIP" ]; do
13 MYIPS=`getent hosts ${SUBDOMAIN}.immae.eu | cut -d' ' -f1 | tr "\\n" ' '`
14 GWIP=`getent hosts vpn.immae.eu | head -n1 | cut -d' ' -f1`
15 sleep 5
16done
17rm -f /tmp/tinc_$NETNAME
18echo -e "MYIPS=\"$MYIPS\"\nGWIP=\"$GWIP\"" > /tmp/tinc_$NETNAME
19ip -6 link set $INTERFACE up mtu 1280
20for MYIP in $MYIPS; do
21 ip -6 addr add $MYIP/96 dev $INTERFACE
22done
23ip -6 route add default via $GWIP