Forum Discussion
Amit_Karnik
Oct 28, 2014Nimbostratus
This 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
}