Forum Discussion
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.
- The_BhattmanNimbostratusHi Vlan,
when DNS_REQUEST { if {[matchregion] ldns My_Region } { log local0. "Drop" drop } log local0. "Not Dropped" }
- Vlan_113259Historic F5 AccountNo joy...
- Vlan_113259Historic F5 AccountBesides the iRule syntax this looks like a bug with the v10.2.0.1707.0 parser. Using the following iRule I get the error text bellow.
- Vlan_113259Historic F5 AccountThis one actually loaded.
- Banyan_He_9636Historic F5 AccountThe syntax matches at least. It's passed. Here is the one working for me. I tested,
- wassimAltostratusThanks Banyan,
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects