Forum Discussion
iRule to check if request comes from any node, any pool, or from list of pools or nodes.
Right now I have an iRule that does this: when CLIENT_ACCEPTED { Check if the client IP address is a node in the VIP's default pool if {[matchclass [IP::client_addr] equals [active_nodes -list [LB::server pool]]]}{
log local0. "SNAT'ing for [IP::client_addr], member of pool [LB::server pool]"
snat automap
} else { log local0. "NO SNAT [IP::client_addr]" } }
But I am getting ready to apply new iRules to that virtual server, that will redirect to other pools based on /someURL.
My problem, is that those other pools are not triggering the above iRule. They are not considered part of that virtual server. I assume because they are not the default pool.
Is there a way to just say something like:
when client_accept, if request comes from any node in any pool, then do x else do y
Or use a datagroup or something to say: when client_accept, if request comes from this list of nodes or pools do x else do y
2 Replies
Hi jwhitene,
I'm using the iRule below to selectively enable SNAT for connection where the client and the pool member is hosted in the same subnet (via /CIDR mask). Its a much more universal approach which doesn't require any Data-Groups and
queries...[active_node]when LB_SELECTED { if { [IP::addr [getfield [IP::client_addr] "%" "1"]/24 equals [getfield [LB::server addr] "%" "1"]/24] } then { snat automap } }Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
