On this page
This is part 12 of a series on learning F5 BIG-IP Local Traffic Manager on a real data-centre fabric running on SONiC switches. Each part goes with a video on the LevelUP I.T. YouTube channel. Part 11 followed a packet with tcpdump. This part puts code in the data path: iRules, each one tested on the wire, and the question of when not to write one.
An iRule is a Tcl script attached to a virtual server and run by TMM, the process that forwards the traffic. It runs on events (when the client connects, when a request is parsed, when a pool member is chosen) and it can read and change almost anything TMM handles, including writing the answer itself. That power is the reason to be careful with it.

What you'll see
- Events, in order, per connection and per request, and what each costs.
- Headers inserted and removed on both sides of the full proxy, and the HTTP profile's header-insert.
- Steering
/api/to its own pool, a trap that depends on OneConnect, and the same steering as an LTM policy. - A redirect to HTTPS and a 503 maintenance answer written by the BIG-IP.
- What a runtime error does to a client, what the BIG-IP checks, and how I decide.
Three tools, in order
To change traffic on a BIG-IP I reach for a profile setting first (compiled, tested, visible on the virtual server), then a local traffic policy (conditions and actions, no code), and only then an iRule. All three run in TMM; they differ in what they can express, what they cost per request, and who can read them during an outage. The rules in this part are files in the lab repository (lab/demo/irules/), loaded with a small helper (lab/demo/f5fn.sh).