Forum Discussion
Irule and Bigip Health
to a problem when using http::respond when at the same time using ASM. (which we do, the problem is documented in sol11143)
Now iam a extreme begineer with irules, so i chose the option to disable ASM before and enable at the start of the irule instead.
Would this work ? or is there a better alternative ?
Also how can i log the execution of the irule, to see that the ASM is in fact disabled and then enabled again.
The irule in question is below:-
when CLIENT_ACCEPTED {
ASM::enable
if {([class match [whereis [IP::client_addr] country] eq allowed_country] or [class match [IP::client_addr] eq allowed_ip])} {
set allowed 1 }
else { set allowed 0 }}
when HTTP_REQUEST {
if { $allowed eq 1 } {
Uncomment the line below to turn on logging.
log local0. "Valid client IP: [IP::client_addr]"
}
else {
ASM::disable
HTTP::respond 403 content "The country or IP is not allowed to access this site"
log local0. "Blocked Country client IP: [IP::client_addr] from [whereis [IP::client_addr] country]" } }
Any thanks for the great help i have recieved and the patience exhibited with the newbies like me.
Regards Craig
1 Reply
- hoolio
Cirrostratus
Hi Craig,
Your iRule is not a serverside rule, so you should be fine with what you have. And you're disabling ASM anyhow, so even if you were liable to hit the issue in ID 221949, disabling ASM in the rule should avoid it.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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