Forum Discussion
Christopher_Boo
Jun 05, 2012Cirrostratus
Need help combining 2 irules
I'm not much of a scripter but I usually figure it out of I stare at it long enough. I'm trying to combine the 2 irules below. I'd like to insert irule 2 at the end of irule 1. The idea is to allow anyone on the network to hit the specified URIs and be directed to the rec.utt.pool, but to only allow internal users (api.network.list class) to go to the api.utt.pool and either drop or provide an http access denied message to everyone else. I'd appreciate any help.
Thanks,
Chris
Irule 1
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/pss-alerts*" -
"/pss-forms*" -
"/pss-reports*" -
"/pss-messaging*" {
pool rec.utt.pool
}
default {
pool api.utt.pool
}
}
}
Irule 2
when CLIENT_ACCEPTED {
if { [class match [IP::client_addr] equals api.network.list] } {
pool api.utt.pool
} else {
drop
}
- Christopher_BooCirrostratusI'm now down to 1 error.
- natheCirrocumulusChristopher,
- Christopher_BooCirrostratusThanks! I tried that and it still gave me an error. I've removed the default bit at the end of the first irule and put an else discard at the end of the second irule. This at least has me functional, though still using 2 irules.
- Richard__HarlanHistoric F5 AccountTry the following I changed it up a little
- Christopher_BooCirrostratusThe problem with this is I want the users on the api.network.list to have access to those URIs for the rec.utt.pool as well. Thanks for the input!
- Richard__HarlanHistoric F5 AccountOk it then this should work I had to double the switch statement but it allows if the ip matches and the URI matches it will goto rec.utt.pool ulse api.utt.pool
- natheCirrocumulusJust refreshed the screen to post my suggestion and Richard had beaten me to it ;-)
- Christopher_BooCirrostratusThat sure looks like it will do the trick. Thanks so much to both of you!
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