Fireqos Reference
Total Page:16
File Type:pdf, Size:1020Kb
FireQOS Reference Copyright (c) 2004,2013-2015 Costa Tsaousis costa@firehol.org Copyright (c) 2012-2015 Phil Whineray phil@firehol.org Version 3.0.0-rc.3 (Built 10 Oct 2015) Contents 1 FireQOS Reference4 1.1 Who should read this manual....................4 1.2 Where to get help..........................4 1.3 Installation..............................4 1.4 Licence................................5 2 Running and Configuring FireQOS6 3 Organising Traffic with FireQOS6 4 Optional Parameters for FireQOS Commands6 5 Manual Pages in Alphabetical Order6 5.1 fireqos(1)...............................6 5.1.1 NAME.............................6 5.1.2 SYNOPSIS..........................6 5.1.3 DESCRIPTION.......................7 5.1.4 COMMANDS.........................7 5.1.5 FILES.............................8 5.1.6 SEE ALSO..........................8 5.2 fireqos.conf(5).............................9 5.2.1 NAME.............................9 1 5.2.2 DESCRIPTION.......................9 5.2.3 SPEED UNITS........................9 5.2.4 EXAMPLE.......................... 10 5.2.5 SEE ALSO.......................... 13 5.3 fireqos-class(5)............................ 14 5.3.1 NAME............................. 14 5.3.2 SYNOPSIS.......................... 14 5.3.3 DESCRIPTION....................... 14 5.3.4 PARAMETERS....................... 15 5.3.5 EXAMPLES......................... 16 5.3.6 SEE ALSO.......................... 17 5.4 fireqos-interface(5).......................... 18 5.4.1 NAME............................. 18 5.4.2 SYNOPSIS.......................... 18 5.4.3 DESCRIPTION....................... 18 5.4.4 PARAMETERS....................... 18 5.4.5 EXAMPLES......................... 19 5.4.6 SEE ALSO.......................... 19 5.5 fireqos-match(5)........................... 20 5.5.1 NAME............................. 20 5.5.2 SYNOPSIS.......................... 20 5.5.3 DESCRIPTION....................... 20 5.5.4 PARAMETERS....................... 21 5.5.5 EXAMPLES......................... 21 5.5.6 SEE ALSO.......................... 22 5.6 fireqos-params(5)........................... 23 5.6.1 NAME............................. 23 5.6.2 SYNOPSIS.......................... 23 5.6.3 DESCRIPTION....................... 23 5.6.4 SEE ALSO.......................... 23 5.7 fireqos-params-class(5)........................ 24 2 5.7.1 NAME............................. 24 5.7.2 SYNOPSIS.......................... 24 5.7.3 DESCRIPTION....................... 24 5.7.4 ceil, max........................... 25 5.7.5 SEE ALSO.......................... 30 5.8 fireqos-params-match(5)....................... 31 5.8.1 NAME............................. 31 5.8.2 SYNOPSIS.......................... 31 5.8.3 DESCRIPTION....................... 32 5.8.4 SEE ALSO.......................... 35 3 The latest version of this manual is available online as a PDF, as single page HTML and also as multiple pages within the website. 1 FireQOS Reference 1.1 Who should read this manual This is a reference guide with specific detailed information on commands and configuration syntax for the FireQOS tool. The reference is unlikely to be suitable for newcomers to the tools, except as a means to look up more information on a particular command. For tutorials and guides to using FireHOL and FireQOS, please visit the website. 1.2 Where to get help The FireHOL website. The mailing lists and archives. The package comes with a complete set of manpages, a README and a brief INSTALL guide. 1.3 Installation You can download tar-file releases by visiting the FireHOL website download area. Unpack and change directory with: tar xfz firehol-version.tar.gz cd firehol-version Options for the configure program can be seen in the INSTALL file and by running: ./configure --help To build and install taking the default options: ./configure && make && sudo make install 4 Alternatively, just copy the sbin/fireqos.in file to where you want it. All of the common SysVInit command line arguments are recognised which makes it easy to deploy the script as a startup service. Packages are available for most distributions and you can use your distribution’s standard commands (e.g. aptitude, yum, etc.) to install these. Note Distributions do not always offer the latest version. You can see what the latest release is on the FireHOL website. 1.4 Licence This manual is licensed under the same terms as the FireHOL package, the GNU GPL v2 or later. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABIL- ITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 5 2 Running and Configuring FireQOS • fireqos(1) - FireQOS program • fireqos.conf(5) - FireQOS configuration file 3 Organising Traffic with FireQOS • fireqos-interface(5) - create an interface definition • fireqos-class(5) - traffic class definition • fireqos-match(5) - QOS traffic match 4 Optional Parameters for FireQOS Commands • fireqos-params-class(5) - optional class parameters • fireqos-params-match(5) - optional match parameters 5 Manual Pages in Alphabetical Order 5.1 fireqos(1) 5.1.1 NAME fireqos - an easy to use but powerful traffic shaping tool 5.1.2 SYNOPSIS fireqos CONFIGFILE [start | debug] [ – conf-arg . ] fireqos { stop | clear_all_qos } fireqos status [name [ dump [class]]] fireqos { dump | tcpdump } name class [ tcpdump-arg ...] fireqos { drops | overlimits | requeues } name 6 5.1.3 DESCRIPTION FireQOS is a program that helps you configure traffic shaping on Linux. Run without any arguments, fireqos will present some help on usage. When given CONFIGFILE, fireqos will use the named file instead of /etc/firehol/fireqos.conf as its configuration. The parameter name always refers to an interface name from the configuration file. The parameter class always refers to a named class within a named interface. It is possible to pass arguments for use by the configuration file separating any conf-arg values from the rest of the arguments with --. The arguments are accessible in the configuration using standard bash(1) syntax e.g. $1, $2, etc. 5.1.4 COMMANDS start; debug Activates traffic shaping on all interfaces, as given in the configu- ration file. When invoked as debug, FireQOS also prints all of the tc(8) commands it executes. stop Removes all traffic shaping applied by FireQOS (it does not touch QoS on other interfaces and IFBs used by other tools). clear_all_qos Removes all traffic shaping on all network interfaces and re- moves all IFB devices from the system, even those applied by other tools. status Shows live utilisation for the specified interface. FireQOS will show you the rate of traffic on all classes, adding one line per second (similarly to vmstat, iostat, etc.) If dump is specified, it tcpdumps the traffic in the given class of the interface. tcpdump; dump FireQOS temporarily mirrors the traffic of any leaf class to an IFB device. Then it runs tcpdump(8) on this interface to dump the traffic to your console. You may add any tcpdump(8) parameters you like to the command line, (to dump the traffic to a file, match a subset of the traffic, etc.), for example this: fireqos tcpdump adsl-in voip -n will start a tcpdump of all traffic on interface adsl-in, in class voip. The parameter -n is a tcpdump(8) parameter. 7 Note When FireQOS is running in tcpdump mode, it locks itself and will refuse to run in parallel with another FireQOS altering the QoS, or tcpdumping other traffic. This is because FireQOS reserves device ifb0 for monitoring. If two FireQOS processes were allowed to tcpdump in parallel, your dumps would be wrong. So it locks itself to prevent such a case. drops Shows packets dropped per second, per class, for the specified interface. overlimits Shows packets delayed per second, per class, for the specified inter- face. requeues Shows packets requeued per second, per class, for the specified inter- face. 5.1.5 FILES /etc/firehol/fireqos.conf 5.1.6 SEE ALSO • fireqos.conf(5) - FireQOS configuration file • FireHOL Website • FireQOS Online PDF Manual • FireQOS Online Documentation • tc(8) - show / manipulate traffic control settings • tcpdump(8) - show / manipulate traffic control settings 8 5.2 fireqos.conf(5) 5.2.1 NAME fireqos.conf - FireQOS configuration file 5.2.2 DESCRIPTION This file defines the traffic shaping that will be applied by fireqos(1). The default configuration file is /etc/firehol/fireqos.conf. It can be over- ridden from the command line. A configuration consists of a number of input and output interface definitions (see fireqos-interface(5)). Each interface can define any number of (optionally nested) classes (see fireqos-class(5)) which shape the traffic which they match (see fireqos-match(5)). 5.2.3 SPEED UNITS In FireQOS, speeds can be expressed in the following units: #bps # bytes per second #kbps;#Kbps # kilobytes per second #mbps;#Mbps # megabytes per second #gbps;#Gbps # gigabytes per second #bit # bits per second #kbit;#Kbit;# # kilobits per second (default) #mbit;#Mbit # megabits per second #gbit;#Gbit # gigabits per second #% In a class, uses this percentage of the enclosing rate. Note The default, kbit is different to tc(8) which assumes bytes per second when no unit is specified.