Forum Discussion
larry_williams2
Nimbostratus
Oct 24, 2014Nesting operations within an iRule
I have 9000+ client subnets grouped into roughly 5 ranges. For example, is it possible to have a single iRule that performs the following evaluation:
if client is in 172.16.0.0/16 then pool 1 ...
Amit_Karnik
Nimbostratus
Oct 28, 2014This is typically easily done with an "ip" type datagroup. You can probably write a small script to create an empty datagroup and then add all the records in it. The key would be the CIDR network and the value would be the pool name.
The iRule snippet you need is
if { [class match [client_addr] equals ] } {
set poolname [class match -value [client_addr] equals ]
pool $poolname
} else {
pool default-pool
}
Here is a sample data-group
ltm data-group internal dg_1 {
records {
10.0.0.0/8 {
data pool1
}
}
type ip
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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