Joe_Gorman_4645
Mar 05, 2012Nimbostratus
Restriction of access to URI by IP
So I'm needing to restrict access to 4 URIs by IP Address. I have created the following iRule and Datagroup. At this time, it works for the first URI in the list, but returns a 404 error for the rest of the URIs below. Is there something that I am missing, it looks like it should function normally.
Thanks
class grs_access {
{
network 10.0.0.0/8
host 50.16.227.16
network 172.16.0.0/16
network 192.168.0.0/16
host 204.236.236.43
}
rule grsreg_whitelist {
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/grda*" {
if {not [matchclass [IP::client_addr] equals grs_access]}{
HTTP::respond 403 content {Blocked!}
}
}
"/grsupport*" {
if {not [matchclass[IP::client_addr] equals grs_access]}{
HTTP::respond 403 content {Blocked!}
}
}
"/grreg*" {
if {not [matchclass[IP::client_addr] equals grs_access]}{
HTTP::respond 403 content {Blocked!}
}
}
"/grrt*" {
if {not [matchclass[IP::client_addr] equals grs_access]}{
HTTP::respond 403 content {Blocked!}
}
}
}
}
}