{"id":4538,"date":"2022-12-20T18:08:59","date_gmt":"2022-12-20T21:08:59","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/shorewalltcclasses-man5\/"},"modified":"2022-12-20T18:08:59","modified_gmt":"2022-12-20T21:08:59","slug":"shorewalltcclasses-man5","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/shorewalltcclasses-man5\/","title":{"rendered":"SHOREWALL&minus;TCCLASSES (man5)"},"content":{"rendered":"<h1 align=\"center\">SHOREWALL\u2212TCCLASSES<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#FILES\">FILES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">tcclasses \u2212 Shorewall file to define HTB and HFSC classes<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p style=\"margin-top: 1em\"><b>\/etc\/shorewall[6]\/tcclasses<\/b><\/p>\n<\/td>\n<td width=\"48%\"> <\/td>\n<\/tr>\n<\/table>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">A note on the <i>rate<\/i>\/bandwidth definitions used in this file:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 don&#8217;t use a space between the integer value and the unit: 30kbit is valid while 30 kbit is NOT.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 you can use one of the following units:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>kpbs<\/b><\/p>\n<p style=\"margin-left:23%;\">Kilobytes per second.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>mbps<\/b><\/p>\n<p style=\"margin-left:23%;\">Megabytes per second.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>kbit<\/b><\/p>\n<p style=\"margin-left:23%;\">Kilobits per second.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>mbit<\/b><\/p>\n<p style=\"margin-left:23%;\">Megabits per second.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b>bps<\/b> or <b>number<\/b><\/p>\n<p style=\"margin-left:23%;\">Bytes per second.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 if you want the values to be calculated for you depending on the output bandwidth setting defined for an interface in tcdevices, you can use expressions like the following:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">full\/3<\/p>\n<p style=\"margin-left:23%;\">causes the bandwidth to be calculated as 1\/3 of the full outgoing speed that is defined.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">full*9\/10<\/p>\n<p style=\"margin-left:23%;\">will set this bandwidth to 9\/10 of the full bandwidth<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">Note that in a sub\u2212class (a class that has a specified parent class), full refers to the RATE or CEIL of the parent class rather than to the OUT\u2212BANDWIDTH of the device.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">DO NOT add a unit to the rate if it is calculated !<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The columns in the file are as follows.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>INTERFACE<\/b> \u2212 <i>interface<\/i>[[:<i>parent<\/i>]:<i>class<\/i>]<\/p>\n<p style=\"margin-left:17%;\">Name of <i>interface<\/i>.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">You may specify the interface number rather than the interface name. If the <b>classify<\/b> option is given for the interface in <b><font color=\"#0000FF\">shorewall\u2212tcdevices<\/font><\/b> <small><font color=\"#000000\">[1]<\/font><\/small> <font color=\"#000000\">(5), then you must also specify an interface class (an integer that must be unique within classes associated with this interface). If the classify option is not given, you may still specify a <i>class<\/i> or you may have Shorewall generate a class number from the MARK value. Interface numbers and class numbers are always assumed to be specified in hex and class number 1 is reserved as the root class of the queuing discipline.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">You may NOT specify wildcards here, e.g. if you have multiple ppp interfaces, you need to put them all in here!<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Please note that you can only use interface names in here that have a bandwidth defined in the<\/font> <b><font color=\"#0000FF\">shorewall\u2212tcdevices<\/font><\/b> <small><font color=\"#000000\">[1]<\/font><\/small> <font color=\"#000000\">(5) file.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Normally, all classes defined here are sub\u2212classes of a root class that is implicitly defined from the entry in<\/font> <b><font color=\"#0000FF\">shorewall\u2212tcdevices<\/font><\/b> <small><font color=\"#000000\">[1]<\/font><\/small> <font color=\"#000000\">(5). You can establish a class hierarchy by specifying a <i>parent<\/i> class \u2212\u2212 the number of a class that you have previously defined. The sub\u2212class may borrow unused bandwidth from its parent.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>MARK<\/b> \u2212 {\u2212|<i>value<\/i>[:<i>priority<\/i>]}<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">The mark <i>value<\/i> which is an integer in the range 1\u2212255. You set mark values in the<\/font> <b><font color=\"#0000FF\">shorewall\u2212mangle<\/font><\/b> <small><font color=\"#000000\">[2]<\/font><\/small> <font color=\"#000000\">(5) file, marking the traffic you want to fit in the classes defined in here. You can use the same marks for different interfaces.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">The <i>priority<\/i>, if specified, is an integer in the range 1\u221265535 and determines the relative order in which the tc mark classification filter for this class is to be applied to packets being sent on the <i>interface<\/i>. Filters are applied in ascending numerical order. If not supplied, the value is derived from the class priority (PRIORITY column value below): (<i>class priority<\/i> << 8) | 20.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>RATE<\/b> \u2212 {\u2212|<i>rate<\/i>[:<i>dmax<\/i>[:<i>umax<\/i>]]}<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">The minimum bandwidth this class should get, when the traffic load rises. If the sum of the rates in this column exceeds the INTERFACE&#8217;s OUT\u2212BANDWIDTH, then the OUT\u2212BANDWIDTH limit may not be honored. Similarly, if the sum of the rates of sub\u2212classes of a class exceed the CEIL of the parent class, things don&#8217;t work well.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">When using the HFSC queuing discipline, this column specify the real\u2212time (RT) service curve. leaf classes may specify <i>dmax<\/i>, the maximum delay in milliseconds that the first queued packet for this class should experience. May be expressed as an integer, optionally followed by &#8216;ms&#8217; with no intervening white\u2212space (e.g., 10ms).<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">HFSC leaf classes may also specify <i>umax<\/i>, the largest packet expected in this class. May be expressed as an integer. The unit of measure is <i>bytes<\/i> and the integer may be optionally followed by &#8216;b&#8217; with no intervening white\u2212space (e.g., 800b). <i>umax<\/i> may only be given if <i>dmax<\/i> is also given.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Beginning with Shorewall 4.5.6, HFSC classes may omit this column (e.g, &#8216;\u2212&#8217; in the column), provided that an <i>lsrate<\/i> is specified (see CEIL below). These rates are used to arbitrate between classes of the same priority.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>CEIL<\/b> \u2212 [<i>lsrate<\/i>:]<i>rate<\/i><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">The maximum bandwidth this class is allowed to use when the link is idle. Useful if you have traffic which can get full speed when more needed services (e.g. ssh) are not used.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">You can use the value <b>full<\/b> in here for setting the maximum bandwidth to the RATE of the parent class, or the OUT\u2212BANDWIDTH of the device if there is no parent class.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Beginning with Shorewall 4.5.6, you can also specify an <i>lsrate<\/i> (link sharing rate).<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>PRIORITY<\/b> \u2212 <i>priority<\/i><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">For HTB: The <i>priority<\/i> in which classes will be serviced by the packet shaping scheduler and also the priority in which bandwidth in excess of the rate will be given to each class.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Higher priority classes will experience less delay since they are serviced first. Priority values are serviced in ascending order (e.g. 0 is higher priority than 1).<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Classes may be set to the same priority, in which case they will be serviced as equals. For both HTB and HFSC, the <i>priority<\/i> is used to calculate the priority of following Shorewall\u2212generated classification filters that refer to the class:<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">\u2022 Packet MARK<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\">\u2022 <b>tcp\u2212ack<\/b> and the <b>tos<\/b> options (see below)<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">The rules for classes with lower numeric priorities will appear before those with higher numeric priorities.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Beginning with Shorewall 4.5.8, the PRIORITY may be omitted from an HFSC class if you do not use the MARK column or the <b>tcp\u2212ack<\/b> or <b>tos<\/b> options. If you use any of those features and omit the PRIORITY, then you must specify a <i>priority<\/i> along with the MARK or option.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>OPTIONS<\/b> (Optional) \u2212 [<i>option<\/i>[<b>,<\/b><i>option<\/i>]&#8230;]<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">A comma\u2212separated list of options including the following:<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><b>default<\/b><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\">This is the default class for that interface where all traffic should go, that is not classified otherwise.<\/font><\/p>\n<p style=\"margin-left:29%; margin-top: 1em\"><font color=\"#000000\"><b><big>Note<\/big><\/b> <br \/> You must define <b>default<\/b> for exactly one class per interface.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><b><big>tos=0x<\/big><\/b><big><i>value<\/i>[\/0x<i>mask<\/i>][:<i>priority<\/i>] (mask defaults to 0xff)<\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>This lets you define a classifier for the given <i>value<\/i>\/<i>mask<\/i> combination of the IP packet&#8217;s TOS\/Precedence\/DiffSrv octet (aka the TOS byte).<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>Beginning with Shorewall 4.5.8, the <i>value\/mask<\/i> may be followed by a colon (&#8220;:&#8221;) and a <i>priority<\/i>. This priority determines the order in which filter rules are processed during packet classification. If not specified, the value (<i>class priority<\/i> << 8) | 15) is used.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b>tos\u2212<\/b><i>tosname<\/i>[:<i>priority<\/i>]<\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big>Aliases for the following TOS octet value and mask encodings. TOS encodings of the &#8220;TOS byte&#8221; have been deprecated in favor of diffserve classes, but programs like ssh, rlogin, and ftp still use them.<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>Beginning with Shorewall 4.5.8, the <i>tos\u2212name<\/i> may be followed by a colon (&#8220;:&#8221;) and a <i>priority<\/i>. This priority determines the order in which filter rules are processed during packet classification. If not specified, the value (<i>class priority<\/i> << 8) | 15) is used.<\/big><\/font><\/p>\n<p style=\"margin-left:29%; margin-top: 1em\"><font color=\"#000000\"><big><b>tos\u2212minimize\u2212delay<\/b> 0x10\/0x10 <b><br \/> tos\u2212maximize\u2212throughput<\/b> 0x08\/0x08 <b><br \/> tos\u2212maximize\u2212reliability<\/b> 0x04\/0x04 <b><br \/> tos\u2212minimize\u2212cost<\/b> 0x02\/0x02 <b><br \/> tos\u2212normal\u2212service<\/b> 0x00\/0x1e<\/big><\/font><\/p>\n<p style=\"margin-left:29%; margin-top: 1em\"><font color=\"#000000\"><big><b><big>Note<\/big><\/b> <br \/> Each of these options is only valid for ONE class per interface.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b><big>tcp\u2212ack[:<\/big><\/b><big><i>priority<\/i><b>]<\/b><\/big><\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big><big>If defined, causes a tc filter to be created that puts all tcp ack packets on that interface that have a size of <=64 Bytes to go in this class. This is useful for speeding up downloads. Please note that the size of the ack packets is limited to 64 bytes because we want only packets WITHOUT payload to match.<\/big><\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big><big>Beginning with Shorewall 4.5.8, the <b>tcp\u2212ack<\/b> may be followed by a colon (&#8220;:&#8221;) and a <i>priority<\/i>. This priority determines the order in which filter rules are processed during packet classification. If not specified, the value (<i>class priority<\/i> << 8) | 10) is used.<\/big><\/big><\/font><\/p>\n<p style=\"margin-left:29%; margin-top: 1em\"><font color=\"#000000\"><big><big><b><big>Note<\/big><\/b> <br \/> This option is only valid for ONE class per interface.<\/big><\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><big><b><big>occurs<\/big><\/b><big>=<i>number<\/i><\/big><\/big><\/big><\/font><\/p>\n<p style=\"margin-left:23%;\"><font color=\"#000000\"><big><big><big>Typically used with an IPMARK entry in tcrules. Causes the rule to be replicated for a total of <i>number<\/i> rules. Each rule has a successively class number and mark value.<\/big><\/big><\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big><big><big>When &#8216;occurs&#8217; is used:<\/big><\/big><\/big><\/font><\/p>\n<p style=\"margin-left:29%; margin-top: 1em\"><font color=\"#000000\"><big><big><big>\u2022 The associated device may not have the &#8216;classify&#8217; option.<\/big><\/big><\/big><\/font><\/p>\n<p style=\"margin-left:29%; margin-top: 1em\"><font color=\"#000000\"><big><big><big>\u2022 The class may not be the default class.<\/big><\/big><\/big><\/font><\/p>\n<p style=\"margin-left:29%; margin-top: 1em\"><font color=\"#000000\"><big><big><big>\u2022 The class may not have any &#8216;tos=&#8217; options (including &#8216;tcp\u2212ack&#8217;).<\/big><\/big><\/big><\/font><\/p>\n<p style=\"margin-left:29%; margin-top: 1em\"><font color=\"#000000\"><big><big><big>\u2022 The class should not specify a MARK value. If one is specified, it will be ignored with a warning message.<\/big><\/big><\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big><big><big>The &#8216;RATE&#8217; and &#8216;CEIL&#8217; parameters apply to each instance of the class. So the total RATE represented by an entry with &#8216;occurs&#8217; will be the listed RATE multiplied by <i>number<\/i>. For additional information, see<\/big><\/big><\/big><\/font> <big><big><big><b><font color=\"#0000FF\">shorewall\u2212tcrules<\/font><\/b><\/big> <font color=\"#000000\">[3] <big>(5).<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>flow=<i>keys<\/i><\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%;\"><big><big><font color=\"#000000\"><big>Shorewall attaches an SFQ queuing discipline to each leaf HTB class. SFQ ensures that each flow gets equal access to the interface. The default definition of a flow corresponds roughly to a Netfilter connection. So if one internal system is running BitTorrent, for example, it can have lots of &#8216;flows&#8217; and can thus take up a larger share of the bandwidth than a system having only a single active connection. The <b>flow<\/b> classifier (module cls_flow) works around this by letting you define what a &#8216;flow&#8217; is. The classifier must be used carefully or it can block off all traffic on an interface! The flow option can be specified for an HTB leaf class (one that has no sub\u2212classes). We recommend that you use the following:<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:29%;\"><big><big><font color=\"#000000\"><big>Shaping internet\u2212bound traffic: <br \/> flow=nfct\u2212src <br \/> Shaping traffic bound for your local net: <br \/> flow=dst<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%;\"><big><big><font color=\"#000000\"><big>These will cause a &#8216;flow&#8217; to consists of the traffic to\/from each internal system.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>When more than one key is give, they must be enclosed in parenthesis and separated by commas.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>To see a list of the possible flow keys, run this command: <b>tc filter add flow help<\/b> Those that begin with &#8220;nfct\u2212&#8221; are Netfilter connection tracking fields. As shown above, we recommend flow=nfct\u2212src; that means that we want to use the source IP address <i>before NAT<\/i> as the key.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>pfifo<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%;\"><big><big><font color=\"#000000\"><big>When specified for a leaf class, the pfifo queuing discipline is applied to the class rather than the sfq queuing discipline.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>limit=<i>number<\/i><\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%;\"><big><big><font color=\"#000000\"><big>Added in Shorewall 4.4.3. When specified for a leaf class, determines the maximum number of packets that may be queued within the class. The <i>number<\/i> must be > 2 and <=128. If not specified, the value 127 is assumed.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>red=(<i>redoption<\/i>=<i>value<\/i>, &#8230;)<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%;\"><big><big><font color=\"#000000\"><big>Added in Shorewall 4.5.6. When specified on a leaf class, causes the class to use the RED (Random Early Detection) queuing discipline rather than SFQ. See tc\u2212red (8) for additional information.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>Allowable <i>redoptions<\/i> are:<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>min <i>min<\/i><\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:29%;\"><big><big><font color=\"#000000\"><big>Average queue size at which marking becomes a possibility.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>max <i>max<\/i><\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:29%;\"><big><big><font color=\"#000000\"><big>At this average queue size, the marking probability is maximal. Must be at least twice <i>min<\/i> to prevent synchronous retransmits, higher for low <i>min<\/i>.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>probability <i>probability<\/i><\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:29%;\"><big><big><font color=\"#000000\"><big>Maximum probability for marking, specified as a floating point number from 0.0 to 1.0. Suggested values are 0.01 or 0.02 (1 or 2%, respectively).<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>limit <i>limit<\/i><\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:29%;\"><big><big><font color=\"#000000\"><big>Hard limit on the real (not average) queue size in bytes. Further packets are dropped. Should be set higher than <i>max<\/i>+<i>burst<\/i>. It is advised to set this a few times higher than <i>max<\/i>. Shorewall requires that <i>limit<\/i> be at least twice <i>min<\/i>.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>burst <i>burst<\/i><\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:29%;\"><big><big><font color=\"#000000\"><big>Used for determining how fast the average queue size is influenced by the real queue size. Larger values make the calculation more sluggish, allowing longer bursts of traffic before marking starts. Real life experiments support the following guide-line: (<i>min<\/i>+<i>min<\/i>+<i>max<\/i>)\/(3*<i>avpkt<\/i>).<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>avpkt <i>avpkt<\/i><\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:29%;\"><big><big><font color=\"#000000\"><big>Optional. Specified in bytes. Used with burst to determine the time constant for average queue size calculations. 1000 is a good value and is the Shorewall default.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>bandwidth <i>bandwidth<\/i><\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:29%;\"><big><big><font color=\"#000000\"><big>Optional. This rate is used for calculating the average queue size after some idle time. Should be set to the bandwidth of your interface. Does not mean that RED will shape for you!<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>ecn<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:29%;\"><big><big><font color=\"#000000\"><big>RED can either &#8216;mark&#8217; or &#8216;drop&#8217;. Explicit Congestion Notification allows RED to notify remote hosts that their rate exceeds the amount of bandwidth available. Non\u2212ECN capable hosts can only be notified by dropping a packet. If this parameter is specified, packets which indicate that their hosts honor ECN will only be marked and not dropped, unless the queue size hits <i>limit<\/i> bytes. Recommended.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>fq_codel[=(<i>codeloption<\/i>=<i>value<\/i>, &#8230;)]<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%;\"><big><big><font color=\"#000000\"><big>Added in Shorewall 4.5.12. When specified for a leaf class, causes the class to use the FQ_CODEL (Fair\u2212queuing Controlled Delay) queuing discipline rather than SFQ. See tc\u2212fq_codel (8) for additional information.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>Allowable <i>codeloptions<\/i> are:<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>limit<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:29%;\"><big><big><font color=\"#000000\"><big>hard limit on the real queue size. When this limit is reached, incoming packets are dropped. If the value is lowered, packets are dropped so that the new limit is met. Default is 1000 packets.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>flows<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:29%;\"><big><big><font color=\"#000000\"><big>is the number of flows into which the incoming packets are classified. Due to the stochastic nature of hashing, multiple flows may end up being hashed into the same slot. Newer flows have priority over older ones. This parameter can be set only at load time since memory has to be allocated for the hash table. Default value is 1024.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>target<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:29%;\"><big><big><font color=\"#000000\"><big>is the acceptable minimum standing\/persistent queue delay. This minimum delay is identified by tracking the local minimum queue delay that packets experience. Default and recommended value is 5ms.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>interval<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:29%;\"><big><big><font color=\"#000000\"><big>is used to ensure that the measured minimum delay does not become too stale. The minimum delay must be experienced in the last epoch of length interval. It should be set on the order of the worst\u2212case RTT through the bottleneck to give endpoints sufficient time to react. Default value is 100ms.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>quantum<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:29%;\"><big><big><font color=\"#000000\"><big>is the number of bytes used as &#8216;deficit&#8217; in the fair queuing algorithm. Default is set to 1514 bytes which corresponds to the Ethernet MTU plus the hardware header length of 14 bytes.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>ecn | noecn<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:29%;\"><big><big><font color=\"#000000\"><big>can be used to mark packets instead of dropping them. If ecn has been enabled, noecn can be used to turn it off and vice\u2212versa. By default, ecn is enabled.<\/big><\/font><\/big><\/big><\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>Example 1:<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><big><font color=\"#000000\"><big>Suppose you are using PPP over Ethernet (DSL) and ppp0 is the interface for this. You have 4 classes here, the first you can use for voice over IP traffic, the second interactive traffic (e.g. ssh\/telnet but not scp), the third will be for all unclassified traffic, and the forth is for low priority traffic (e.g. peer\u2212to\u2212peer).<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>The voice traffic in the first class will be guaranteed a minimum of 100kbps and always be serviced first (because of the low priority number, giving less delay) and will be granted excess bandwidth (up to 180kbps, the class ceiling) first, before any other traffic. A single VoIP stream, depending upon codecs, after encapsulation, can take up to 80kbps on a PPPoE\/DSL link, so we pad a little bit just in case. (TOS byte values 0xb8 and 0x68 are DiffServ classes EF and AFF3\u22121 respectively and are often used by VOIP devices).<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>Interactive traffic (tos\u2212minimum\u2212delay) and TCP acks (and ICMP echo traffic if you use the example in tcrules) and any packet with a mark of 2 will be guaranteed 1\/4 of the link bandwidth, and may extend up to full speed of the link.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>Unclassified traffic and packets marked as 3 will be guaranteed 1\/4th of the link bandwidth, and may extend to the full speed of the link.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>Packets marked with 4 will be treated as low priority packets. (The tcrules example marks p2p traffic as such.) If the link is congested, they&#8217;re only guaranteed 1\/8th of the speed, and even if the link is empty, can only expand to 80% of link bandwidth just as a precaution in case there are upstream queues we didn&#8217;t account for. This is the last class to get additional bandwidth and the last to get serviced by the scheduler because of the low priority.<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>#INTERFACE MARK RATE CEIL PRIORITY OPTIONS <br \/> ppp0 1 100kbit 180kbit 1 tos=0x68\/0xfc,tos=0xb8\/0xfc <br \/> ppp0 2 full\/4 full 2 tcp\u2212ack,tos\u2212minimize\u2212delay <br \/> ppp0 3 full\/4 full 3 default <br \/> ppp0 4 full\/8 full*8\/10 4<\/big><\/font><\/big><\/big><\/p>\n<h2>FILES <a name=\"FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>\/etc\/shorewall\/tcclasses<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>\/etc\/shorewall6\/tcclasses<\/big><\/font><\/big><\/big><\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><big><big><b><font color=\"#0000FF\">https:\/\/shorewall.org\/traffic_shaping.htm<\/font><\/b><\/big> <font color=\"#000000\">[4]<\/font><\/big><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><big><b><big><font color=\"#0000FF\">https:\/\/shorewall.org\/configuration_file_basics.htm#Pairs<\/font><\/big><\/b> <font color=\"#000000\">[5]<\/font><\/big><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>tc\u2212hfsc(7)<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>tc\u2212red(8)<\/big><\/font><\/big><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><big><font color=\"#000000\"><big>shorewall(8)<\/big><\/font><\/big><\/big><\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><big><big><font color=\"#000000\"><big>1.<\/big><\/font><\/big><\/big><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"29%\">\n<p style=\"margin-top: 1em\"><big><big><font color=\"#000000\"><big>shorewall-tcdevices<\/big><\/font><\/big><\/big><\/p>\n<\/td>\n<td width=\"54%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><big><big><font color=\"#000000\"><big>https:\/\/shorewall.org\/manpages\/shorewall-tcdevices.html<\/big><\/font><\/big><\/big><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><big><big><font color=\"#000000\"><big>2.<\/big><\/font><\/big><\/big><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"25%\">\n<p style=\"margin-top: 1em\"><big><big><font color=\"#000000\"><big>shorewall-mangle<\/big><\/font><\/big><\/big><\/p>\n<\/td>\n<td width=\"58%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><big><big><font color=\"#000000\"><big>https:\/\/shorewall.org\/manpages\/shorewall-mangle.html<\/big><\/font><\/big><\/big><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><big><big><font color=\"#000000\"><big>3.<\/big><\/font><\/big><\/big><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"26%\">\n<p style=\"margin-top: 1em\"><big><big><font color=\"#000000\"><big>shorewall-tcrules<\/big><\/font><\/big><\/big><\/p>\n<\/td>\n<td width=\"57%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><big><big><font color=\"#000000\"><big>https:\/\/shorewall.org\/manpages\/shorewall-tcrules.html<\/big><\/font><\/big><\/big><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><big><big><font color=\"#000000\"><big>4.<\/big><\/font><\/big><\/big><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"63%\">\n<p style=\"margin-top: 1em\"><big><big><font color=\"#000000\"><big>https:\/\/shorewall.org\/traffic_shaping.htm<\/big><\/font><\/big><\/big><\/p>\n<\/td>\n<td width=\"20%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><big><big><font color=\"#000000\"><big>https:\/\/shorewall.org\/traffic_shaping.htm<\/big><\/font><\/big><\/big><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><big><big><font color=\"#000000\"><big>5.<\/big><\/font><\/big><\/big><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"83%\">\n<p style=\"margin-top: 1em\"><big><big><font color=\"#000000\"><big>https:\/\/shorewall.org\/configuration_file_basics.htm#Pairs<\/big><\/font><\/big><\/big><\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><big><big><font color=\"#000000\"><big>https:\/\/shorewall.org\/configuration_file_basics.htm#Pairs<\/big><\/font><\/big><\/big><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  tcclasses \u2212 Shorewall file to define HTB and HFSC classes <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[959],"tags":[961,1291,1498],"class_list":["post-4538","post","type-post","status-publish","format-standard","hentry","category-5-formatos-de-ficheros","tag-961","tag-man5","tag-shorewall-tcclasses"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=4538"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4538\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}