linux网卡限速

#安装git

yum -y install git

#下载wondershaper

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

#查看查用命令

cd wondershaper/

./wondershaper -h

USAGE: ./wondershaper [-hcs] [-a ] [-d ] [-u ]

Limit the bandwidth of an adapter

OPTIONS:
   -h           Show this message
   -a Set the adapter
   -d    Set maximum download rate (in Kbps) and/or
   -u    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 -d -u
   wondershaper -c -a
   wondershaper -s -a

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

 

测试,因为只有5M带宽所以只能跑到500K左右

你可能感兴趣的:(运维工程师必备)