#!/bin/sh +x
-IP=/sbin/ip
-
SLICE=$1
SLICEID=`id -u $SLICE`
NODEID=$2
### 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 type eth remote $REMOTE key $KEY ttl 64
+ip link set $EGRE up
### Setup macvlan
MACV=a$LINK
### Put a process in the vserver so we can move the interface there
su $SLICE -c "sleep 30 &"
PID=`su $SLICE -c "pgrep -n sleep"`
-$IP link set $MACV netns $PID
+ip link set $MACV netns $PID
naddress --add --nid $SLICEID --ip ${VIRTIP}${SUBNET}
su $SLICE -c "sudo /sbin/ifconfig $MACV ${VIRTIP}${SUBNET} mtu 1458 up"
### Set rate
+ifconfig $EGRE txqueuelen 1000
tc qdisc add dev $EGRE root handle 1: htb default 10
tc class add dev $EGRE parent 1: classid 1:10 htb rate $RATE ceil $RATE