Forum Discussion
Using iRule, specify a port for a pool that accepts all ports.
For reasons I won't justify here, I have a pool that accepts traffic on all ports, a virtual server receiving traffic on 443 (SSL), and I need an iRule that sets the server port to 1000 for all requests (no if condition; just do it always). I believe port translation should be disabled on the VIP (it currently is, though I've tried it both ways). HTTP_REQUEST is as far as the traffic gets. Traffic never gets to the pool, let alone the desired port. I've tried a dozen different methods, but none of them work. Here's some examples that do not work:
when LB_SELECTED { switch [LB::server port] { 1000 } }
when LB_SELECTED { switch [TCP::server_port] { 1000 } }
I've also tried other events to no avail with variations with and without switch.
- jaikumar_f5
Noctilucent
Can you run the below for us,
tmsh list ltm virtual
tmsh list ltm pool
- Jer-O
Cirrus
I just want to know the syntax to designate the server port from an iRule on a pool that accepts all ports. The configs aren't relevant to the question beyond what I've already described.
- jaikumar_f5
Noctilucent
Your switch syntax is wrong I guess, there is no string pattern search or default.
But we dont need switch here, your requirement would be below,
Your requirement would be something below,
when LB_SELECTED { if {[LB::server port] == 0} { LB::reselect node [LB::server addr] 1000 }
- youssef1
Cumulonimbus
Hi,
Check this link:
https://devcentral.f5.com/articles/irules-101-05-selecting-pools-pool-members-and-nodes
when HTTP_REQUEST { if { [HTTP::uri] starts_with "/path" } { node [LB::server] 443 } else { pool HTTP_pool } }
- Kevin_Stewart
Employee
You can also do this:
when CLIENT_ACCEPTED { pool test-pool log local0. "TEST: [LB::select]" set this_service [LB::select] node [lindex ${this_service} 3] 1000 }
Recent Discussions
Related Content
* 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