TC-ROUTE(8)
โจ Route classifier in tc(8) โจ
okay bestie, let's talk about the route filter! ๐ It's a traffic control filter for tc(8), and it's the one that sorts packets by their routing table entries ๐ฆ
๐ NAME
route - route traffic control filter
๐ง SYNOPSIS
tc filter ... route [ from REALM | fromif TAG ] [ to REALM ] [ classid
CLASSID ] [ action ACTION_SPEC ]
๐ธ DESCRIPTION
Match packets based on routing table entries. โจ The whole vibe of this filter is that you can give a routing table entry a realm ๐ For any packet this filter looks at, it does a routing table lookup, grabs the returned realm, and uses that to decide whether the packet is a match or not ๐
๐ OPTIONS
action ACTION_SPECโ slap an action from the generic actions framework onto every matching packet โจclassid CLASSIDโ yeet matching packets straight into the class identified byCLASSID๐from REALMfromif TAGโ do source route lookups ๐TAGis the name of an interface, and it has to actually exist on the system when you runtcor it's a no-go ๐to REALMโ match if the normal (aka destination) routing hands back the givenREALM๐ฆ
๐ EXAMPLES
Okay so imagine the subnet 192.168.2.0/24 is attached to eth0 ๐
ip route add 192.168.2.0/24 dev eth0 realm 2
Next up, this route filter will catch packets from that subnet ๐ซถ
tc filter add ... route from 2 classid 1:2
and then it passes them along to class 1:2. Iconic. ๐
โจ
โญ NOTES
โ ๏ธ Heads up! Due to implementation details, realm values have to be in a range from0to255, inclusive. No going outside that range ๐ญ Alternatively, you can use a verbose name defined in/etc/iproute2/rt_realmsinstead, which is lowkey so much easier to read ๐
๐ SEE ALSO
tc(8), ip-route(8) ๐
Thanks for hanging with me through this one, bestie! ๐ซถ iproute2 ยท 21 Oct 2015 ยท Route classifier in tc(8) ๐
๐ฆ 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 bookworm: iproute2 6.1.0-3 ยท GPL-2.0-only
- 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 jammy: iproute2 5.15.0-1ubuntu2 ยท GPL-2.0-only
- ubuntu jammy: iproute2 5.15.0-1ubuntu2.2 ยท GPL-2.0-only
- ubuntu noble: iproute2 6.1.0-1ubuntu6 ยท GPL-2.0-only
- ubuntu noble: iproute2 6.1.0-1ubuntu6.4 ยท 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