Forum Discussion
Zabeel_101104
Oct 20, 2011Nimbostratus
irule issue with priority groups and continue to end of script
Hi,
We have an issue with our irules where access-lists are used for users to only be able to access whats defined in the group for them only for website access. Issue we have is that I would like them to continue dropping into other groups if no match is found for what they are trying to get to.
At the moment they get to whats defined in there own group and thats all nothing else. Without having to duplicate urls for users I would like to make this efficient where if the match is not found they continue into other groups defined in priority 509 as below on till the end then stop. In between there are other irules as 501 which is ip address controlled.
Attached is a ommited version of the irule we have in place
This iRule Processes requests which were not caught by the HTTP Class
and handles access restrictions to certain sites
when HTTP_REQUEST priority 501 {
group 1 IPs Only
if { [class match [IP::client_addr] eq grp-1] } {
log local0. "Entered 501 this group 501"
Disable LDAP Authentication via APM
ACCESS::disable
Access controlled by source address Sites
Anything that doesn't match exit Event
switch -glob [string tolower [HTTP::host]] {
"websiteurlhere.com" { pool grp-server2 }
default { return }
}
}
}
....
....
....
when HTTP_REQUEST priority 509 {
log local0. "Entered 509 to get my_host"
set my_host [string tolower [HTTP::host]]
}
when ACCESS_ACL_ALLOWED {
log local0. "APM Done - ACL Allowed"
Everyone Else
All Other Sites
Anything that doesn't match send a RST
switch -glob $my_host { "host_url_here" { pool grp-webserver1 }
default { return }
}
}
}
Any help appreciated
Regards
Zabeel
- Zabeel_101104Nimbostratusanyone ?
- John_Alam_45640Historic F5 AccountAt first glance, it looks like the: default {return} is causing the irule to stop processing that event.
- Zabeel_101104NimbostratusHi John
- Michael_YatesNimbostratusYou do not need to list a default action unless you have one. The normal default action (unless you specify one) will allow all traffic that does not qualify for an iRule action to be passed through to the default pool applied to the Virtual Server.
when HTTP_REQUEST { if { [class match [IP::client_addr] eq grp-1] } { ACCESS::disable switch -glob [string tolower [HTTP::host]] { "websiteurlhere.com" { pool grp-server2 } } } } when ACCESS_ACL_ALLOWED { switch -glob [string tolower [HTTP::host]] { "host_url_here" { pool grp-webserver1 } } }
- Zabeel_101104NimbostratusThanks for the reply Michael.
- Zabeel_101104NimbostratusThanks for the reply Michael.
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