Forum Discussion
Ken_B_50116
Cirrostratus
Jan 15, 2016iRule to match IP subnet in a routing domain
I need an iRule that matches a network subnet that is also a routing domain. In human terms, I need to match this:
10.15.115.0%1/24
Currently I am using this code and it works, but I want to be m...
Kai_Wilke
MVP
Jan 15, 2016Hi Ken,
you may try this syntax...
if { [IP::addr [getfield [IP::client_addr] "%" 1] equals 10.15.115.0/24 ] } then {
match
} else {
no match
}
Note1: The [class] command have to be used in combination with datagroups only.
Note2: Both the [IP::addr] and [class] commands requiring to strip the route domain to work.
Note3: Your current code is performance wise the best choice for /8, /16 or /24 subnets.
Note4: Coding on a iPhone doesnt make fun at all. So please bear with me if the code has some syntax errors... 😉
Cheers, Kai
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
