X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=factory%2Fsetup-link;h=58a431f3940e0b90def0048f65870b1c2572d51d;hb=4eccf5deff6324957d0bf0799dee6decb8d5f05a;hp=b8c748c9ed7075a4054c5fb0f29131662168b437;hpb=ff59db26ff8e6f8ba6969ed93bb4cca88a3b7c2d;p=vsys.git diff --git a/factory/setup-link b/factory/setup-link index b8c748c..58a431f 100755 --- a/factory/setup-link +++ b/factory/setup-link @@ -6,7 +6,16 @@ SLICE=$1 SLICEID=`id -u $SLICE` read INDEX read REMOTE -read KEY + +KEYFILE="/etc/vini/egre-keys.txt" +if [ -e "$KEYFILE" ]; then + KEY=$( awk -v slice=$SLICE '$1 == slice {print $2}' $KEYFILE ) +fi +if [ -z "$KEY" ]; then + echo "No EGRE key found for slice $SLICE!" + echo "Please send mail to vini-users@lists.planet-lab.org." + exit 1 +fi LINK=${KEY}if${INDEX} @@ -15,7 +24,7 @@ modprobe etun ### Setup EGRE tunnel EGRE=d$LINK -$IP tunnel add $EGRE mode gre/eth remote $REMOTE key $KEY +$IP tunnel add $EGRE mode gre/eth remote $REMOTE key $KEY ttl 64 $IP link set $EGRE up ### Setup etun @@ -36,7 +45,7 @@ ifconfig $BRIDGE up iptables -t mangle -A FORWARD -o $BRIDGE -j MARK --set-mark $SLICEID ### Create "grab link" script -GRAB=/vsys/grab-$ETUN0 +GRAB=/vsys/local_grab-$ETUN0 echo $SLICE > $GRAB.acl rm -f $GRAB cat > $GRAB < $BIND.acl rm -f $BIND cat > $BIND < $DELETE.acl rm -f $DELETE cat > $DELETE <