Forum Discussion
Drew666
Sep 27, 2019Nimbostratus
iRule Creation Query
Hi, Have created a very simple iRule to extract the incoming Client destination TCP ports using the switch cmd to redirect to specific nodes: when HTTP_REQUEST { switch { TCP::local_port...
- Sep 27, 2019
Hi Drew,
Can you try this iRule?
when HTTP_REQUEST { set port [TCP::client_port] # log local0. "Port: $port" if { ($port > 8000) and ($port < 8151) } { set newlastoctet [expr $port - 7900] # log local0. "NewLastOctet: $newlastoctet" node "10.100.10.$newlastoctet:6660" } }
Drew666
Sep 27, 2019Nimbostratus
Hi Eaa,
That's looking spot on! (I'll test it next week).
(I obviously was going down the wrong path with the "for" loop logic)
So I gather [TCP::client_port] extracts destination port? Why I ask is that I could determined if it referred to either the source or destination TCP port?
Thank you
Regards
Drew
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects