/* * Simply commented example of a tcng traffic control file. * * Martin A. Brown * * Example: Using class selection path. * * (If you are reading the processed output in HTML, the callouts are * clickable links to the description text.) * */ #include "fields.tc" #include "ports.tc" #define INTERFACE eth0 dev INTERFACE { egress { /* section in which we configure the filters */ class ( <$ssh> ) if tcp_sport == 22 && ip_tos_delay == 1 ; class ( <$audio> ) if tcp_sport == 554 || tcp_dport == 7070 ; /* note that numbers and names are acceptable */ class ( <$bulk> ) \ if tcp_sport == PORT_SSH || tcp_dport == PORT_HTTP ; class ( <$other> ) if 1 ; /* select anything leftover */ /* section in which we configure the qdiscs and classes */ htb () { class ( rate 600kbps, ceil 600kbps ) { $ssh = class ( rate 64kbps, ceil 128kbps ) ; $audio = class ( rate 128kbps, ceil 128kbps ) ; $bulk = class ( rate 256kbps, ceil 512kbps ) ; $other = class ( rate 128kbps, ceil 384kbps ) ; } } } }