Kevin_Nail
Feb 09, 2011Nimbostratus
Datagroup and class match
Been scouring through the docs and can't find any good resource that addresses my question. Please help.
I am tasked with creating an iRule that will check incoming packets for the client_ip and compare them against a list of IPs to block with exceptions
I am using version 10.2 and have an Irule started:
when HTTP_REQUEST {
Check if the client IP is a member of the exception list
log local0.debug "IRule has been triggered"
if { ([class match [IP::client_addr] equals ip_exception])} {
log local0.debug "[IP::client_addr] Your IP was approved via the exception list"
Client IP matched the class, so allow it }
else {
log local0.debug "[IP::cleint_addr] Your IP was NOT approved via the exception list"
drop
}
}
I'm working on a bigger picture, trying to get the smaller pieces working.
I have a datagroup defined as an external class in /var/class names ip_exception.
The problem is I cannot tell if it is being accessed at all, The last statement in my irule always shows up.
Next problem is that I don't know how to add data the external class list from the command line. The help section is very confusing.
So can you look at my iRule and let me know if in its simplicity it looks ok?
Can you tell me how to add IPs (data) to the exception list from the command line?
Many thanks,
Kevin