X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=setup-egre-link;h=56771f60175e436912586a1dacd32312e2236059;hb=f9245e44c20a170157d5151083ff70ae1154e34a;hp=e6494af18f028c6e23f0ba24c3b0273fa738be79;hpb=f6ed4fcd49097356b5f23143e1df6fc7eb20dcb4;p=nodemanager-topo.git diff --git a/setup-egre-link b/setup-egre-link index e6494af..56771f6 100755 --- a/setup-egre-link +++ b/setup-egre-link @@ -21,29 +21,16 @@ 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 +### Setup macvlan +MACV=a$LINK +ip link add link $EGRE $MACV type macvlan ### 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 $ETUN0 netns $PID +$IP link set $MACV netns $PID naddress --add --nid $SLICEID --ip ${VIRTIP}${SUBNET} -su $SLICE -c "sudo /sbin/ifconfig $ETUN0 ${VIRTIP}${SUBNET} up; sudo /sbin/route add -net $VIRTNET dev $ETUN0" +su $SLICE -c "sudo /sbin/ifconfig $MACV ${VIRTIP}${SUBNET} mtu 1458 up" ### Set rate tc qdisc add dev $EGRE root handle 1: htb default 10