linux 限制上傳下載速度


#安裝git

yum -y install git

#下載wondershaper

git clone  https://github.com/magnific0/wondershaper.git

第二種安裝依賴以及工具:

yum install epel-release -y yum install wondershaper -y

#查看查用命令

cd wondershaper/

./wondershaper -h

USAGE: ./wondershaper [-hcs] [-a <adapter>] [-d <rate>] [-u <rate>]

Limit the bandwidth of an adapter

OPTIONS:
   -h           Show this message
   -a <adapter> Set the adapter
   -d <rate>    Set maximum download rate (in Kbps) and/or
   -u <rate>    Set maximum upload rate (in Kbps)
   -p           Use presets in /etc/conf.d/wondershaper.conf
   -c           Clear the limits from adapter
   -s           Show the current status of adapter
   -v           Show the current version

MODES:
   wondershaper -a <adapter> -d <rate> -u <rate>
   wondershaper -c -a <adapter>
   wondershaper -s -a <adapter>

EXAMPLES:
   wondershaper -a eth0 -d 1024 -u 512
   wondershaper -a eth0 -u 512
   wondershaper -c -a eth0
#限制命令

./wondershaper -a ens192 -u 1000 -d 10240
 

#網卡 ens192 上傳限制到1000kb 下載限制到 10240kb

清除原有規則 (兩個參數可以是任何字符)
wondershaper clean clean


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM