Add the source files for the swift library.
[swifty.git] / src / libswift / mfold / netroot.default.sh
1 #!/bin/bash
2
3 if [ ! $EMIF ] ; then
4     exit
5 fi
6
7 TC="sudo tc "
8
9 # echo cleanup
10 # $TC qdisc del dev $EMIF root
11 # $TC qdisc del dev $EMIF ingress
12 # $TC qdisc del dev ifb0 root
13
14 echo ifb0 up
15 sudo modprobe ifb
16 sudo ip link set dev ifb0 up
17
18 echo set lo mtu to 1500
19 sudo ifconfig lo mtu 1500 || exit 1
20  
21 # Should return OK, when using multiple peers in same host
22 echo adding ingress
23 $TC qdisc add dev $EMIF ingress || exit 0
24
25 echo redirecting to ifb
26 $TC filter add dev $EMIF parent ffff: protocol ip prio 1 u32 \
27         match u32 0 0 flowid 1:1 action mirred egress redirect dev ifb0 || exit 3
28
29 echo adding ifb0 root htb
30 $TC qdisc add dev ifb0 handle 1: root htb || exit 4
31
32 echo adding $EMIF root htb
33 $TC qdisc add dev $EMIF handle 1: root htb || exit 5
34
35 echo adding lo root htb
36 $TC qdisc add dev lo handle 1: root htb || exit 6