Forum Discussion
KPS_149915
Nimbostratus
Apr 06, 2017IRule based on src IP LTM
Hi
My plan is to allow from 2 subnets and direct to a pool, below irule is not working, if any one knows why it is not working, please share,
when CLIENT_ACCEPTED {
if { [IP::addr [IP::cl...
Ed_Summers
Nimbostratus
Apr 06, 2017This would be a good application for a data group. Not only would it make the rule easier to update and scale, it will make the tcl code much simpler.
Create a data group (give it a descriptive name...I'll just use 'allowed-subnets'):
create ltm data-group internal allowed-subnets type ip records add { 10.x.x.x/24 10.y.y.y/24 }
Now you can use this data group for matching in your iRule
when CLIENT_ACCEPTED {
if { [class match [IP::client_addr] eq allowed-subnets] } {
pool my.pool
}
}
In the future, allowing additional subnets (or even host addresses) is a matter of adding to the data group. No changes to the iRule would be required.
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