Vlan_113259
Oct 28, 2010Historic F5 Account
GTM iRule help with matchregion?
After reading the documentation for the new v10.1.x iRule feature for GTM I still can not create an iRule that the GTM will accept. Has anyone actually used this? If so can you send me your example.
In short what the iRule is for is to drop non-local user queries for specific wideips. In other words if not of a local network drop the request.
I looked in to using matchclass but this is not functional in GTM and utilizing a data group or region would be cleaner than multiple elseif statements.
Here is the link to the feature: http://devcentral.f5.com/wiki/default.aspx/iRules/matchregion.html
This is what is documented:
Description Returns true/false if specified region is matched.
Syntax matchregion
Examples
Related Information
Valid Events: | DNS_REQUEST,DNS_RESPONSE |
Sample Code:
Introduced GTM-10.1
Here is my iRule test:
when DNS_REQUEST {
if { ! [matchregion] equals My_Region } {
} else {
drop
}
}
or
when DNS_REQUEST {
if { [matchregion] equals My_Region } {
} else {
drop
}
}
or
when DNS_REQUEST {
if { [[matchregion ip] equals My_Region] } {
} else {
drop
}
}
or
when DNS_REQUEST {
if { ! [matchregion] equals My_Region } {
} else {
drop
}
}
Note: if you place a $ or $:: as part of My_Region or if you remove the negation the iRule still fails to parse.