FLOW-XLATE(1)
π FLOW-XLATE(1) β the flow-tools glow-up page
okay bestie, gather round, because this is flow-xlate from flow-tools, manual section 1, and she is that girl. Let's get into it. β¨
πΈ NAME πΈ
flow-xlate β Apply translations to selected fields of a flow. no cap, that's the whole gig.
π SYNOPSIS π
flow-xlate [ -hkn ] [ -b big|little ] [ -C comment ] [ -d debug_level
] [ -v variable binding ] [ -V flow_version ] [ -x xlate_fname ] [
-X xlate_definition ] [ -z z_level ]
π¦ DESCRIPTION π¦
So the flow-xlate utility is used to apply translations to flows. Translations live in a configuration file, and they're made of actions plus a definition that invokes action(s). Definitions are in the form of terms, and each term can have a filter and multiple actions. it's giving modular, honestly.
Words in the configuration file of the form @VAR or @{VAR:default} get expanded at run-time by setting variable names with the -v option. very variable, very slay.
Translation actions begin with the xlate-action keyword followed by a symbolic name. Each action has a type defined below.
Translation definitions begin with the xlate-definition keyword followed by a symbolic name. Each definition is composed of terms which are evaluated in the order of the configuration file. A term may invoke a filter to conditionally invoke an action. periods. π
β¨ Action types and their sub-commands β¨
π§ Address β network
ip-source-address-to-networkβ Zero host bits based on mask.ip-destination-address-to-networkβ Zero host bits based on mask.- (no sub-commands) β literally none, she's self-sufficient.
π§ Address β class network
ip-source-address-to-class-networkβ Zero source host bits to match class.ip-destination-address-to-class-networkβ Zero dst host bits to match class.- (no sub-commands)
π§ Anonymize
ip-source-address-anonymizeβ Anonymize source address.ip-destination-address-anonymizeβ Anonymize destination address.ip-address-anonymizeβ Anonymize src/dst address.
All three of these share the same sub-commands:
algorithmβ Algorithm.cryptopan-aes128is currently supported.
algorithm cryptopan-aes128
keyβ Key. Key is 128 bits in hex.
key 0123456789ABCDEFG
key-fileβ File to load key from. Key is 128 bits in hex.
key-file /mfstmp/secret-key
key-file-refreshβ How often to check the key file. Interval is in minutes, the optional second argument ishour:min:secto specify the first refresh. This example will load a new key every day at12:00:00.
14400 12:00:00
π§ Privacy masks
ip-address-privacy-maskβ Apply a mask to the source and destination address to remove bits.ip-port-privacy-maskβ Apply a mask to the source and destination port to remove bits.
π§ tag-mask
tag-maskβ Apply mask to the source and destination tag.maskβ Source and Destination mask to apply.
mask 0xFFFF 0xFFFF
π§ scale
scaleβ Scale packets and bytes.scaleβ Scale to apply.
scale 100
π§ replace AS 0
replace-source-as0β Replace source AS 0replace-destination-as0β Replace destination AS 0asβ AS replacement value.
as 3112
π OPTIONS π
-b big|littleβ Byte order of output.-C Commentβ Add a comment.-d debug_levelβ Enable debugging.-hβ Display help.-kβ Keep time from input.-nβ Don't load configuration file. Useful only with-V-v variable bindingβ Set a variableFOO=bar.-V pdu_versionβ Use pdu_version format output. the roster:1β NetFlow version 1 (No sequence numbers, AS, or mask)5β NetFlow version 56β NetFlow version 6 (5+ Encapsulation size)7β NetFlow version 7 (Catalyst switches)8.1β NetFlow AS Aggregation8.2β NetFlow Proto Port Aggregation8.3β NetFlow Source Prefix Aggregation8.4β NetFlow Destination Prefix Aggregation8.5β NetFlow Prefix Aggregation8.6β NetFlow Destination (Catalyst switches)8.7β NetFlow Source Destination (Catalyst switches)8.8β NetFlow Full Flow (Catalyst switches)8.9β NetFlow ToS AS Aggregation8.10β NetFlow ToS Proto Port Aggregation8.11β NetFlow ToS Source Prefix Aggregation8.12β NetFlow ToS Destination Prefix Aggregation8.13β NetFlow ToS Prefix Aggregation8.14β NetFlow ToS Prefix Port Aggregation1005β Flow-Tools tagged version 5
-x xlate_fnameβ Translation config file name. Defaults to/etc/flow-tools/cfg/xlate.cfg-X xlate_definitionβ Translation definition. Defaults todefault.-z z_levelβ Configure compression level toz_level.0is disabled (no compression),9is highest compression.
π EXAMPLES π
π example one: downgrade that version
Convert the version 7 flows in flows.v7 to version 5, storing the result in flows.v5.
flow-xlate -V5 < flows.v7 > flows.v5
π example two: the privacy mask saga
Set the low 11 bits in the IP addresses to zero unless the address is multicast or it belongs to the 192.88.99/24 network.
# xlate.cfg
include-filter filter.cfg
xlate-action MULTICAST-PRIVACY
type ip-address-privacy-mask
mask 0xFFFFFFFF 0xFFFFFFFF
xlate-action UNICAST-PRIVACY
type ip-address-privacy-mask
mask 0xFFFFFF00 0xFFFFF800
xlate-definition abilene_privacy
term
filter mcast
action MULTICAST-PRIVACY
stop
term
filter ucast
action UNICAST-PRIVACY
# filter.cfg
filter-primitive MCAST
type ip-address-mask
permit 224.0.0.0 240.0.0.0
filter-primitive UCAST
type ip-address-mask
deny 224.0.0.0 240.0.0.0
default permit
filter-primitive SKIP
type ip-address-mask
deny 192.88.99.0 255.255.255.0
default permit
filter-definition mcast
match ip-destination-address MCAST
filter-definition ucast
match ip-destination-address UCAST
match ip-destination-address SKIP
match ip-source-address SKIP
flow-cat flows | flow-xlate -xxlate.cfg -Xabilene_privacy | flow-print
π«Ά FILES π«Ά
Configuration files:
- Symbols β
/etc/flow-tools/sym/*. - Filter β
/etc/flow-tools/cfg/filter.cfg. - Xlate β
/etc/flow-tools/cfg/xlate.cfg.
π BUGS π
bestie. listen. the scale option can overflow the 32 bit flow counters. This could be solved by detecting this condition and splitting the flow in two. (she has not been solved. be careful.)
Translation between aggregated and non aggregated formats is not supported. don't try it, it's not a vibe.
π AUTHOR π
Mark Fullmer <maf@splintered.net> β the icon, the legend, the moment.
β SEE ALSO β
and that's the whole page, bestie π β straight from the flow-tools set, dated 26 ΠΠ²Π³ΡΡΡ 2010 (that's August 26, 2010 for the calendar girlies), and yes it really is titled FLOW-XLATE(1) at the top and bottom like a little matching set. periodt. π
π¦ where this page comes from
- fedora 43: flow-tools 0.68.5.1-45.fc43 Β· LicenseRef-Callaway-BSD
- fedora 43: flow-tools 0.68.5.1-45.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: flow-tools 0.68.5.1-46.fc44 Β· LicenseRef-Callaway-BSD
- fedora 44: flow-tools 0.68.5.1-46.fc44 Β· LicenseRef-Callaway-BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms