X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=exec%2Fsetup-link;h=d56c91a04e472247e012d0f1cf74ef57de1b0395;hb=c0aaafa7ae3daf7ed9c6ca1459fc28a32b0fceff;hp=e5cbd2f1f6270da78cdf2ce96a2f96c437327b50;hpb=3ee4bdc7ef3082207bcca23235bd4402fb61c95e;p=vsys-scripts.git diff --git a/exec/setup-link b/exec/setup-link index e5cbd2f..d56c91a 100755 --- a/exec/setup-link +++ b/exec/setup-link @@ -1,7 +1,5 @@ #!/bin/sh +x -IP=/sbin/ip - SLICE=$1 SLICEID=`id -u $SLICE` read INDEX @@ -11,17 +9,16 @@ read KEY LINK=${KEY}if${INDEX} modprobe ip_gre -modprobe etun ### Setup EGRE tunnel EGRE=d$LINK -$IP tunnel add $EGRE mode gre/eth remote $REMOTE key $KEY -$IP link set $EGRE up +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 -echo $ETUN0,$ETUN1 > /sys/module/etun/parameters/newif +ip link add name $ETUN0 type veth peer name $ETUN1 ifconfig $ETUN0 mtu 1458 up ifconfig $ETUN1 up @@ -44,7 +41,7 @@ cat > $GRAB < /sys/class/net/$ETUN0/new_ns_pid +ip link set $ETUN0 netns $PID EOF chmod +x $GRAB @@ -79,7 +76,7 @@ read NULL iptables -t mangle -D FORWARD -o $BRIDGE -j MARK --set-mark $SLICEID # Get rid of etun devices, only need name of one of them -echo $ETUN1 > /sys/module/etun/parameters/delif +ip link delete dev $ETUN1 # Get rid of bridge ifconfig $BRIDGE down