Home Contact Download

asyd.net

Welcome to Bruno Bonfils's (aka asyd homepage).

Example

qos.conf

fmt_version 1.0

action {
        module ipgpc
        name ipgpc.classify
        params {
                global_stats TRUE
        }
         
        class {
                name global
                next_action shaping
        }
         
        filter {
                name all
                direction LOCAL_OUT
                class global
        }
}
 
action {
        module tokenmt
        name shaping
        params {
                # Values in bps (bits per sercond)

                committed_rate           1024000
                committed_burst         11520000

                red_action_name         drop
                green_action_name       continue
                global_stats            FALSE
        }
}

Enable QoS

# ipqosconf -f
# ipqosconf -a qos.conf
# ipqosconf -l

Enable QoS at boot

# ipqosconf -a qos.conf
# ipqosconf -c

Stats

-bash-3.00# kstat -m ipgpc
module: ipgpc                           instance: 7     
name:   ipgpc_global_stats              class:    ipgpc.classify
        crtime                          86839.761132583
        epackets                        0
        nbytes                          69565819
        nclasses                        2
        nfilters                        1
        npackets                        73931
        snaptime                        87413.738107878
-bash-3.00# kstat -m tokenmt
module: tokenmt                         instance: 8     
name:   tokenmt statistics              class:    shaping
        crtime                          86839.761628401
        epackets                        0
        green_bits                      448531952
        green_packets                   37860
        red_bits                        95812288
        red_packets                     7990
        snaptime                        87426.400482897
        yellow_bits                     0
        yellow_packets                  0

Comments

You MUST have an action named ipgpc.classify, with module ipgpc. This module allow to use differents class according some IP headers and few others values. Here, I use LOCAL_OUT to match the _whole_ outgoing traffic. The class global is called, which call itself the action shaping.

Overview

qos.jpg