X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=factory%2Fsetup-link;h=5c93a3095d80ee69ce8a31bb630a28847170711c;hb=29c254469667d325b86ec3fa438581ab34f3244d;hp=df3638f57847ed1025658d2321acfa4ad20e4da7;hpb=a73b5037e7e3d2dc9520d3ce40e4ef3e2756ab6b;p=vsys.git diff --git a/factory/setup-link b/factory/setup-link index df3638f..5c93a30 100755 --- a/factory/setup-link +++ b/factory/setup-link @@ -22,7 +22,7 @@ $IP link set $EGRE up ETUN0=v$LINK ETUN1=etun$LINK echo $ETUN0,$ETUN1 > /sys/module/etun/parameters/newif -ifconfig $ETUN0 up +ifconfig $ETUN0 mtu 1458 up ifconfig $ETUN1 up ### Setup bridge @@ -32,8 +32,13 @@ 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/grab-$ETUN0 +echo $SLICE > $GRAB.acl +rm -f $GRAB cat > $GRAB < /sys/class/net/$ETUN0/new_ns_pid EOF chmod +x $GRAB -echo $SLICE > $GRAB.acl +### Create "bind link" script +BIND=/vsys/bind-link-$ETUN0 +echo $SLICE > $BIND.acl +rm -f $BIND +cat > $BIND < $UNBIND < $DELETE.acl +rm -f $DELETE +cat > $DELETE < /sys/module/etun/parameters/delif + +# Get rid of bridge +ifconfig $BRIDGE down +brctl delbr $BRIDGE + +# Get rid of EGRE tunnel +ip tunnel del $EGRE + +# Clean up files +rm -f $GRAB $GRAB.acl +rm -f $DELETE $DELETE.acl +rm -f $BIND $BIND.acl +rm -f $UNBIND $UNBIND.acl +EOF +chmod +x $DELETE