X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=factory%2Fsetup-link;fp=factory%2Fsetup-link;h=0000000000000000000000000000000000000000;hb=65f0b4dd113321ced69ea976a64f6f06fb4e3660;hp=cc800ce8701183a867df118d1b754a4f96295b77;hpb=da01b364b3c3e91a120037d2fcf0993bfbd26900;p=vsys.git diff --git a/factory/setup-link b/factory/setup-link deleted file mode 100755 index cc800ce..0000000 --- a/factory/setup-link +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh +x - -SLICE=$1 -SLICEID=`id -u $SLICE` -read INDEX -read REMOTE -read KEY - -LINK=${KEY}if${INDEX} - -modprobe ip_gre - -### Setup EGRE tunnel -EGRE=d$LINK -ip tunnel add $EGRE mode gre type eth remote $REMOTE key $KEY ttl 64 -ip link set $EGRE up - -### Setup etun -ETUN0=a$LINK -ETUN1=b$LINK -ip link add name $ETUN0 type veth peer name $ETUN1 -ifconfig $ETUN0 mtu 1458 up -ifconfig $ETUN1 up - -### Setup bridge -BRIDGE=c$LINK -brctl addbr $BRIDGE -brctl addif $BRIDGE $EGRE -brctl addif $BRIDGE $ETUN1 -ifconfig $BRIDGE up - -### Setup iptables so that packets are visible in the vserver -iptables -t mangle -A FORWARD -o $BRIDGE -j MARK --set-mark $SLICEID - -### Create "grab link" script -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 <