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] } {
Thanks! 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.
First I check the IP address, if match send to pool and drop out of the iRule. If not match fall through to the switch statement. If there is no match send a reset and move on.
when HTTP_REQUEST {
if { [class match [IP::client_addr] equals api.network.list] } {
Ok 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
when HTTP_REQUEST {
if { [class match [IP::client_addr] equals api.network.list] } {