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