TC-MATCHALL(8)
๐ 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 byCLASSID๐ง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 ๐
that's the whole page, bestie ๐ source: iproute2, dated 21 Oct 2015, and yes it's still giving ๐๐ง
๐ฆ where this page comes from
- alpine 3.22: iproute2-doc 6.15.0-r0 ยท GPL-2.0-or-later
- alpine 3.23: iproute2-doc 6.17.0-r0 ยท GPL-2.0-or-later
- alpine 3.24: iproute2-doc 7.0.0-r0 ยท GPL-2.0-or-later
- arch rolling: iproute2 7.2.0-1
- arch rolling: iproute2 7.3.0-1 ยท GPL-2.0-or-later
- centos-stream 10: iproute-tc 7.0.0-2.el10 ยท GPL-2.0-or-later
- centos-stream 9: iproute-tc 6.17.0-3.el9 ยท GPL-2.0-or-later
- debian trixie: iproute2 6.15.0-1 ยท GPL-2.0-only
- fedora 43: iproute-tc 6.14.0-2.fc43 ยท GPL-2.0-or-later
- fedora 44: iproute-tc 6.17.0-2.fc44 ยท GPL-2.0-or-later
- nixos 26.05: iproute2 7.0.0
- nixpkgs unstable: iproute2 7.2.0
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- ubuntu questing: iproute2 6.16.0-1ubuntu2
- ubuntu questing: iproute2 6.16.0-1ubuntu2.1 ยท GPL-2.0-only
- ubuntu questing: iproute2 6.16.0-1ubuntu2.2
- ubuntu resolute: iproute2 6.19.0-1ubuntu1 ยท GPL-2.0-only
- ubuntu resolute: iproute2 6.19.0-1ubuntu1.1 ยท GPL-2.0-only
- ubuntu stonking: iproute2 7.2.0-1ubuntu1 ยท GPL-2.0-only
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms