Skip to content

Instantly share code, notes, and snippets.

View pcheliniy's full-sized avatar
🐝
Working from home

Denis Ivanov pcheliniy

🐝
Working from home
View GitHub Profile
#!/bin/bash
echo 3 > /proc/sys/vm/drop_caches
sync
err="not enough RAM"
mem=`free|grep Mem:|awk '{print $4}'`
swap=`free|grep Swap:|awk '{print $3}'`
test $mem -lt $swap && echo -e $err && exit 1
swapoff -a && swapon -a &&
modprobe ifb
ip link set dev ifb0 up
tc qdisc del dev bond1 root
tc qdisc add dev bond1 root handle 2: prio
tc filter add dev bond1 parent 2: protocol ip u32 match u32 0 0 flowid ffff action mirred egress redirect dev ifb0
tc filter add delete bond1 parent 2: protocol ip u32 match u32 0 0 flowid ffff action mirred egress redirect dev ifb0