Flower filter in tc(8)

NAME
flower - flow based traffic control filter

SYNOPSIS
tc filter ... flower [ MATCH_LIST ] [ action ACTION_SPEC ] [ classid CLASSID ]
MATCH_LIST := [ MATCH_LIST ] MATCH
MATCH := { indev ifname | skip_sw | skip_hw | { dst_mac | src_mac } mac_address | vlan_id VID | vlan_prio PRIORITY | vlan_ethtype { ipv4 | ipv6 | ETH_TYPE } | ip_proto { tcp | udp | sctp | icmp | icmpv6 | IP_PROTO } | { dst_ip | src_ip } { ipv4_address | ipv6_address } | { dst_port | src_port } port_number } | enc_key_id KEY-ID | { enc_dst_ip | enc_src_ip } { ipv4_address | ipv6_address } | enc_dst_port UDP-PORT |

DESCRIPTION
The flower filter matches flows to the set of keys specified and assigns an arbitrarily chosen class ID to packets belonging to them. Additionally (or alternatively) an action from the generic action framework may be called.

OPTIONS

action ACTION_SPEC
    Apply an action from the generic actions framework on matching packets.

classid CLASSID
    Specify a class to pass matching packets on to. CLASSID is in the form X:Y, while X and Y are interpreted as numbers in hexadecimal format.

indev ifname
    Match on incoming interface name. Obviously this makes sense only for forwarded flows. ifname is the name of an interface which must exist at the time of tc invocation.

skip_sw
    Do not process filter by software. If hardware has no offload support for this filter, or TC offload is not enabled for the interface, operation will fail.

skip_hw
    Do not process filter by hardware.

dst_mac mac_address
src_mac mac_address
    Match on source or destination MAC address.

vlan_id VID
    Match on vlan tag id. VID is an unsigned 12bit value in decimal format.

vlan_prio PRIORITY
    Match on vlan tag priority. PRIORITY is an unsigned 3bit value in decimal format.

vlan_ethtype VLAN_ETH_TYPE
    Match on layer three protocol. VLAN_ETH_TYPE may be either ipv4, ipv6 or an unsigned 16bit value in hexadecimal format.

ip_proto IP_PROTO
    Match on layer four protocol. IP_PROTO may be tcp, udp, sctp, icmp, icmpv6 or an unsigned 8bit value in hexadecimal format.

dst_ip ADDRESS
src_ip ADDRESS
    Match on source or destination IP address. ADDRESS must be a valid IPv4 or IPv6 address, depending on protocol option of tc filter.

dst_port NUMBER
src_port NUMBER
    Match on layer 4 protocol source or destination port number. Only available for ip_proto values udp, tcp and sctp which have to be specified in beforehand.

type NUMBER
code NUMBER
    Match on ICMP type or code. Only available for ip_proto values icmp and icmpv6 which have to be specified in beforehand.

enc_key_id NUMBER
enc_dst_ip ADDRESS
enc_src_ip ADDRESS
enc_dst_port NUMBER
    Match on IP tunnel metadata. Key id NUMBER is a 32 bit tunnel key id (e.g. VNI for VXLAN tunnel). ADDRESS must be a valid IPv4 or IPv6 address. Dst port NUMBER is a 16 bit UDP dst port.

NOTES
As stated above where applicable, matches of a certain layer implicitly depend on the matches of the next lower layer. Precisely, layer one and two matches (indev, dst_mac and src_mac) have no dependency, layer three matches (ip_proto, dst_ip and src_ip) depend on the protocol option of tc filter, layer four port matches (dst_port and src_port) depend on ip_proto being set to tcp, udp or sctp, and finally ICMP matches (code and type) depend on ip_proto being set to icmp or icmpv6.

There can be only used one mask per one prio. If user needs to specify different mask, he has to use different prio.

SEE ALSO
tc(8), tc-flow(8)