【利用tc做简单的限速策略】tcqdisc.sh
#!/bin/sh # # tcqdisc.sh [a|c|d|s] interface [delay|loss] N[ms|%] # # action=$1 eth=$2 option=$3 value=$4 case $action in a) tc qdisc add dev $eth root netem $option $value ;; c) tc qdisc change dev $eth root netem $option $value ;; d) tc qdisc del dev $eth root netem $option $value ;; s) tc qdisc show ;; *) echo "Usage: $0 [a|c|d|s] interface [delay|loss] N[ms|%]" echo " a: tc qdisc add dev..." echo " c: tc qdisc change dev..." echo " d: tc qdisc del dev..." echo " s: tc qdisc show" ;; esac
转载于:https://blog.51cto.com/nosmoking/1595243