Forum Discussion
hooleylist
Jun 22, 2012Cirrostratus
If you're on 9.4.4 or higher make sure to remove the $:: prefix from the data group name. You can add debug logging to figure out why the iRule isn't working. Here's a version 10 or higher example:
when HTTP_REQUEST {
if { [class match [IP::client_addr] equals Whitelist_Sorry] } {
log local0. "[IP::client_addr]:[TCP::client_port]: Client is in data group so do not redirect. DG: [class get Whitelist_Sorry]"
} else {
log local0. "[IP::client_addr]:[TCP::client_port]: Client is not in data group so redirect"
HTTP::redirect
}
}
Also, [IP::client_addr] and [IP::remote_addr] will return the same value in clientside events like CLIENT_ACCEPTED and HTTP_REQUEST.
Aaron