---
name: "fireqos-match4"
section: "5"
platform: "linux"
package: "fireqos-doc"
version: "3.1.8+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/fireqos-match"
---

# fireqos-match4(5)

QOS traffic match

Part of [fireqos-match(5)](/fireqos-match/5.md).

## NAME

fireqos-match - QOS traffic match

## SYNOPSIS

{match\|match4\|match6\|match46} *optional-match-params*

## DESCRIPTION

Writing `match` inherits the IPv4/IPv6 version from its enclosing class (see [fireqos-class(5)](/fireqos-class/5.md)).

Writing `match4` includes only IPv4 traffic in the match.

Writing `match6` includes only IPv6 traffic in the match.

Writing `match46` includes both IPv4 and IPv6 traffic in the match.

You can add as many `match` statements as you like to a FireQOS configuration. They assign traffic to a class: by default to the class after which they are declared.

The sequence that matches appear in the configuration defines their priority, with the first match being given a `prio` of 10, with 10 added for each subsequent match (10, 20, 30, ...).

Matches can have their priority assigned explicitly with the `prio` parameter. See [fireqos-params-match(5)](/fireqos-params-match/5.md).

If one `match` statement generates multiple [tc(8)](/tc/8.md) `filter` statements, all filters generated by the same `match` statement will have the same `prio`.

**Note**

`match` rules are attached to the parent of the `class` they appear in. Within the configuration they are written under a class, but in reality they are attached to their class parent, so that they classify the parent’s traffic that they match, into the class.

It is also possible to group all `match` statements together below the classes. This allows them to be arranged in preferred order, without the need for any explicit `prio` parameters. In this case however, each match statement must specify to which class it classifies the packets it matches, using the `class` parameter. See [fireqos-params-match(5)](/fireqos-params-match/5.md) and the examples below.

You can also write `client` and `server` statements, much like FireHOL allows, with the same service definitions. For FireQOS however, the client ports are ignored. `server` statements match the server ports on this linux side, while `client` statements match the server ports on the remote side.

Example:

-

  ```
      server_myrtp_ports="10000:10100"
      interface eth0 lan bidirectional rate 1Gbit
        class voip
          server sip
          client sip
          server myrtp
        class dns
          server dns
        class mail
          server smtp
  ```

## PARAMETERS

- *optional-match-params*

  The set of optional parameters which describe this match. See [fireqos-params-match(5)](/fireqos-params-match/5.md).

## EXAMPLES

Match traffic within classes:

-

  ```
      interface eth0 lan output rate 1Gbit
        class voip
          match udp ports 5060,10000:10100
        class dns
          match udp port 53
        class mail
          match tcp port 25
  ```

Matches split out and explicitly assigning traffic to classes (N.B. without the `class` parameters, all traffic would be classified into \`mail'):

-

  ```
      interface eth0 lan output rate 1Gbit
        class voip
        class dns
        class mail
        match udp ports 5060,10000:10100 class voip
        match tcp port 25 class mail
        match tcp port 80 class web
  ```

## SEE ALSO

- •

  [fireqos-params-match(5)](/fireqos-params-match/5.md) - QOS match parameters

- •

  [fireqos(1)](/fireqos/1.md) - FireQOS program

- •

  [fireqos.conf(5)](/fireqos.conf/5.md) - FireQOS configuration file

- •

  [fireqos-interface(5)](/fireqos-interface/5.md) - QOS interface definition

- •

  [fireqos-class(5)](/fireqos-class/5.md) - QOS class definition

- •

  FireHOL Website ⟨http://firehol.org/⟩\\c

- •

  FireQOS Online PDF Manual ⟨http://firehol.org/fireqos-manual.pdf⟩\\c

- •

  FireQOS Online Documentation ⟨http://firehol.org/documentation/⟩\\c

- •

  [tc(8)](/tc/8.md) ⟨http://lartc.org/manpages/tc.html⟩\\c  - show / manipulate traffic control settings

## AUTHORS

FireHOL Team.
