Forum Discussion
chris_connell_1
Nimbostratus
Apr 21, 2009Quickest way to do this
I want to do this in my virtual server irule.
Could someone confirm if for my irule below
only 1 condition is met and i will get this behaviour:
i,e
if the destination address is in the blocked list, its rejected.
OR
if the source matches clients and active mebers are more than 48 forward to ingress pool
OR
if the source is in the testrange then forward to test pool
OR everythign else
forward
Is it better to use a switch/case for this? but there are a few variables here.
when CLIENT_ACCEPTED {
if { [matchclass [IP::local_addr] equals $::blocked]} {
reject
} elseif { [matchclass [IP::remote_addr] equals $::clients] and [active_members Ingress] >= 48 } {
pool Ingress
} elseif { [matchclass [IP::remote_addr] equals $::testpool] } {
pool Ingress-test
} else {
forward
}
}
- dennypayne
Employee
Hi, - chris_connell_1
Nimbostratus
- hoolio
Cirrostratus
You're correct, you can't use a switch to check the condition of multiple variables.
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