Skip to content

Instantly share code, notes, and snippets.

@hrqiang
Created December 17, 2015 06:36
Show Gist options
  • Save hrqiang/ecce34646f7a189ba0f1 to your computer and use it in GitHub Desktop.
Save hrqiang/ecce34646f7a189ba0f1 to your computer and use it in GitHub Desktop.
if test "$1" = "stop"; then
tc qdisc del dev eth0 ingress
tc qdisc del dev ifb0 root
ip link set dev ifb0 down
else
modprobe ifb
ip link set dev ifb0 up
tc qdisc add dev eth0 ingress
tc filter add dev eth0 parent ffff: protocol ip u32 match ip src 63.209.0.73 flowid 1:1 action mirred egress redirect dev ifb0
tc qdisc add dev ifb0 root netem delay 200ms
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment