TC-MATCHALL(8)

๐Ÿ“ฆ
version 7.3.0 ยท 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’… tc-matchall(8) โ€” Match-all classifier in tc(8) ๐Ÿ’…

okay bestie, this is the manual page for matchall, the tc filter that catches every single packet ๐Ÿฆ‹ no exceptions, no cap. main character energy fr ๐Ÿ‘‘

โœจ NAME โœจ

matchall โ€” traffic control filter that matches every packet ๐Ÿ’–

๐ŸŽ€ SYNOPSIS ๐ŸŽ€

tc filter ... matchall [ skip_sw | skip_hw  ] [ action ACTION_SPEC ] [
        classid CLASSID ]

๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so the matchall filter lets you classify every packet that flows through the port, and then run an action on it. it's giving total packet domination ๐Ÿ’…โœจ

๐Ÿฆ‹ OPTIONS ๐Ÿฆ‹

  • action ACTION_SPEC โ€” slap an action from the generic actions framework onto the packets that match ๐Ÿ”ฅ
  • classid CLASSID โ€” toss the matching packets into the class identified by CLASSID ๐Ÿงš
  • skip_sw โ€” don't process the filter in software ๐Ÿ’€ if the hardware can't offload this filter, or TC offload isn't turned on for the interface, the operation will fail. no backup plan, bestie ๐Ÿ˜ญ
  • skip_hw โ€” don't process the filter in hardware ๐Ÿ™ˆ

๐Ÿ“ EXAMPLES ๐Ÿ“

okay these are the iconic ones ๐Ÿซถ

๐Ÿชž Ingress mirroring from eth1 to eth2

say you want to mirror everything coming in on port eth1 over to port eth2:

tc qdisc  add dev eth1 handle ffff: clsact
tc filter add dev eth1 ingress                \
        matchall skip_sw                      \
        action mirred egress mirror           \
        dev eth2

the first command creates a clsact qdisc with handle ffff: on device eth1, and the second attaches a matchall filter on it that mirrors the packets to device eth2 for ingress. ate, no crumbs ๐Ÿ’œ

๐Ÿชž Egress mirroring from eth1 to eth2

now the reverse: mirroring everything going out of eth1 to eth2:

tc qdisc add dev eth1 handle ffff: clsact
tc filter add dev eth1 egress                  \
        matchall skip_sw                       \
        action mirred egress mirror            \
        dev eth2

same vibe as before. the first command makes a clsact qdisc with handle ffff: on device eth1, and the second attaches a matchall filter that mirrors the packets to device eth2 for egress ๐ŸŒˆ

๐Ÿง Sampling one of every 100 packets into psample group 12

want a little taste instead of the whole buffet? sample one of every 100 packets flowing into eth0 and send them to psample group 12:

tc qdisc add dev eth0 handle ffff: ingress
tc filter add dev eth0 parent ffff: matchall \
     action sample rate 100 group 12

๐Ÿ”— SEE ALSO ๐Ÿ”—

tc(8),


that's the whole page, bestie ๐ŸŽ€ source: iproute2, dated 21 Oct 2015, and yes it's still giving ๐Ÿ’–๐Ÿงš