Forum Discussion
AaronMLong_1021
Jun 14, 2012Cirrus
Class Match iRule problem
So I'm writing a simple dust page rule, which I want to make a few exceptions
based on source address. I used to have a if/then/else nightmare in 9.4.4, so
I'm not sorry to revisit the issue, but the class match syntax is still evading
me, I think. Either that or there's some other screwup in here I'm missing:
when HTTP_REQUEST {
if { [class match [IP::client_addr] equals
"AWS_EC2"] } {
Allow Amazon EC2 nodes past DUST Page
} elseif
{ [class match [IP::client_addr] equals "Testers"] } {
Allow Testers
past DUST Page
} else {
HTTP::redirect
"URL"
}
}
My data groups are entered using the Data Group Editor in the F5 iRule Editor, under Addresses. When I access from an IP listed in my class match clauses, I still get redirected to URL. What am I screwing up?
- hooleylistCirrostratusHi Aaron,
when HTTP_REQUEST { log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::method] to [virtual name] [HTTP::host][HTTP::uri]" if { [class match [IP::client_addr] equals AWS_EC2] } { Allow Amazon EC2 nodes past DUST Page log local0. "[IP::client_addr]:[TCP::client_port]: Matched AWS_EC2" } elseif { [class match [IP::client_addr] equals Testers] } { Allow Testers past DUST Page log local0. "[IP::client_addr]:[TCP::client_port]: Matched Testers" } else { HTTP::redirect "URL" log local0. "[IP::client_addr]:[TCP::client_port]: No match in AWS_EC2: [class get AWS_EC2] or Testers: [class get Testers]" } }
- Okay, I added the log data, and now I'm really baffled:
- Okay, I added the log data, and now I'm really baffled:
- MiLK_MaNNimbostratusCan you paste the contents of your data-group?
- I entered the networks via the Data Group Editor in the F5 iRule editor. Right now my testers data group has:
- MiLK_MaNNimbostratusTry changing the entry to be 209.119.85.5%1 in the data-group.
- Done. No change in the output:
- Any more help incoming on this one? It's not as if I'm trying to do something particularly bizarre and difficult.
- hooleylistCirrostratusData groups and the associated lookup commands (matchclass, class, findclass, etc) do not support route domains yet. See this thread for details and possible workarounds:
- Ah, thank you! Moving my class to the common partition seems to have done the trick. Strange behaviour.
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