云服务器

推荐列表 站点导航

当前位置:首页 > 服务器技术 > 云服务器 >

服务器_Linux系统服务器站点流量限制的方案,#! /bin/sh # Simple bandwidth lim

来源:网络整理  作者:  发布时间:2020-12-20 01:16
Linux系统服务器站点流量限制的方案,#! /bin/sh # Simple bandwidth limiter - [email][email protected][/email] # Change this to your link bandwidth #...

  # We're talking about megabits, not megabytes, so 80Kbit is

  iptables -t mangle -A OUTPUT -p tcp ——sport 80 -j MARK ——set-mark 1

  tc filter add dev "$NIC" parent 1: protocol ip handle 1 fw classid 1:10

本文作者:

  tc qdisc add dev "$NIC" root handle 1: cbq \

  REAL_BW='10Mbit'

  tc qdisc del dev "$NIC" root 2> /dev/null

  # 10 Kilobytes/s

  # get, not the speed of a local Ethernet link)

  # Change this to the bandwidth you want to allocate to WEB.

  tc class add dev "$NIC" parent 1: classid 1:1 cbq bandwidth "$REAL_BW" \

  rate "$REAL_BW" maxburst 1 avpkt 1000

  # Change this to your link bandwidth

  WEB_BW='1000Kbit'

  # Simple bandwidth limiter - <[email][email protected][/email]>

  bandwidth "$REAL_BW" avpkt 1000

  tc qdisc add dev "$NIC" parent 1:10 sfq perturb 10

  # (for cable modem, DSL links, etc. put the maximal bandwidth you can

  bandwidth "$REAL_BW" rate "$WEB_BW" maxburst 1 avpkt 1000 bounded

  # Change this to your physical network device (or 'ppp0')

  tc class add dev "$NIC" parent 1:1 classid 1:10 cbq \

  NIC='eth0'

相关热词: 服务器 Linux

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/server/yun/5898.shtml

最新文章
租用云服务器后的备案问 租用云服务器后的备案问

时间:2021-01-05

百度云服务器bcc有什么优 百度云服务器bcc有什么优

时间:2021-01-05

什么是云服务器cvm?怎么 什么是云服务器cvm?怎么

时间:2021-01-05

云服务器怎么保证信息安 云服务器怎么保证信息安

时间:2021-01-05

云服务器怎么预防被攻击 云服务器怎么预防被攻击

时间:2021-01-05

阿里云ECS实例设置用户r 阿里云ECS实例设置用户r

时间:2020-12-29

阿里云ECS服务器入门使用 阿里云ECS服务器入门使用

时间:2020-12-29

怎么配置云服务器 怎么配置云服务器

时间:2020-12-28

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

服务器_Linux系统服务器站点流量限制的方案,#! /bin/sh # Simple bandwidth lim

2020-12-20 编辑:

  # We're talking about megabits, not megabytes, so 80Kbit is

  iptables -t mangle -A OUTPUT -p tcp ——sport 80 -j MARK ——set-mark 1

  tc filter add dev "$NIC" parent 1: protocol ip handle 1 fw classid 1:10

本文作者:

  tc qdisc add dev "$NIC" root handle 1: cbq \

  REAL_BW='10Mbit'

  tc qdisc del dev "$NIC" root 2> /dev/null

  # 10 Kilobytes/s

  # get, not the speed of a local Ethernet link)

  # Change this to the bandwidth you want to allocate to WEB.

  tc class add dev "$NIC" parent 1: classid 1:1 cbq bandwidth "$REAL_BW" \

  rate "$REAL_BW" maxburst 1 avpkt 1000

  # Change this to your link bandwidth

  WEB_BW='1000Kbit'

  # Simple bandwidth limiter - <[email][email protected][/email]>

  bandwidth "$REAL_BW" avpkt 1000

  tc qdisc add dev "$NIC" parent 1:10 sfq perturb 10

  # (for cable modem, DSL links, etc. put the maximal bandwidth you can

  bandwidth "$REAL_BW" rate "$WEB_BW" maxburst 1 avpkt 1000 bounded

  # Change this to your physical network device (or 'ppp0')

  tc class add dev "$NIC" parent 1:1 classid 1:10 cbq \

  NIC='eth0'

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/server/yun/5898.shtml

相关文章

风云图片

推荐阅读

返回云服务器频道首页