zoukankan      html  css  js  c++  java
  • tc限速配置

    #TC 限速
    #https://blog.csdn.net/zhongbeida_xue/article/details/54613750
    #https://blog.51cto.com/13162375/2112847
    #https://blog.csdn.net/eydwyz/article/details/53320612
    #https://lartc.org/howto/lartc.qdisc.classful.html

    #!/bin/bash
    WANDEV=eth0
    LANDEV=eth1
    ALLOUT=200mbit
    EVERYIPOUT=100mbit
    ALLIN=200mbit
    EVERYIPIN=100mbit

    #上传速率做流量控制
    tc qdisc del dev $WANDEV root 2>/dev/null
    #根队列
    tc qdisc add dev $WANDEV root handle 1:0 htb default 60
    #根类
    tc class add dev $WANDEV parent 1:0 classid 1:1 htb rate $ALLOUT ceil $ALLOUT prio 0
    #子类
    tc class add dev $WANDEV parent 1:1 classid 1:11 htb rate $EVERYIPOUT ceil $EVERYIPOUT prio 1 burst 96kbit
    #设置队列规则
    tc qdisc add dev $WANDEV parent 1:11 handle 111:0 sfq perturb 10
    tc filter add dev $WANDEV parent 1:0 protocol ip prio 1 u32 match ip src 192.168.122.0/24 flowid 1:11


    #做下载限制,过滤器是用u32
    tc qdisc del dev $LANDEV root 2>/dev/null
    #根队列
    tc qdisc add dev $LANDEV root handle 2:0 htb default 30
    #根类
    tc class add dev $LANDEV parent 2:0 classid 2:1 htb rate $ALLIN ceil $ALLIN prio 0
    #子类
    tc class add dev $LANDEV parent 2:1 classid 2:11 htb rate $EVERYIPIN ceil $EVERYIPIN prio 1
    #设置队列规则
    tc qdisc add dev $LANDEV parent 2:11 sfq perturb 10
    tc filter add dev $LANDEV parent 2:0 protocol ip prio 2 u32 match ip dst 192.168.122.0/24 flowid 2:11

    #查看流量
    #tc -s qdisc ls dev eth0
    #tc -s qdisc ls dev eth1
    #tc -s class ls dev eth0
    #tc -s class ls dev eth1

  • 相关阅读:
    windows10 gcc编译C程序(简单编译)
    windows10 下 gcc/g++ 的安装
    神经网络内在逻辑:没打开的AI“黑匣子”
    tensorflow的变量作用域
    如何手画三相电相(线)电压(流)波形图
    pycharm如何添加固定代码块
    pycharm的个性化设置
    zookeeper学习三
    zookeeper学习二
    es中对mapping的理解
  • 原文地址:https://www.cnblogs.com/larrypeng/p/11579654.html
Copyright © 2011-2022 走看看