Forum Discussion
vinceKahn_97184
Mar 14, 2011Historic F5 Account
GTM - Topology irule
I'm trying to create an irule that uses one of my defined topology records to make a decision. I thought maybe "matchregion" would do it but can't get it to work. Maybe this isn't what matchregion is for? But in the example below it doesn't matter if i say equal or not equal it's never true. Any ideas?
when DNS_REQUEST {
if { [matchregion [IP::client_addr] equals Parkwood] } {
host 10.1.1.1
}
}
7 Replies
- The_Bhattman
Nimbostratus
Hi Vince,
It's a good start. You just have to make slight changes.
The following is a wiki reference for matchregion
http://devcentral.f5.com/wiki/default.aspx/iRules/matchregion.html
Thus your code changes to the following:when DNS_REQUEST { if { [matchregion ldns ip] equals $Parkwood } { host 10.1.1.1 } }
I hope this helps
Bhattman - wassim
Altostratus
Hi guys,
It does not seems to be working with me !! how about you Vince ?
when DNS_REQUEST {
if { [matchregion ldns ip] equals $CGNO}{
host 10.1.1.1
log local2. "**** Request from [IP::client_addr]****"
}
else { host 2.2.2.2
log local2. "****Request from [IP::client_addr] ****"
}
}
I configured Region using the Big-IP GUI:
CGNO
IP:subnet is x.x.x.x/24
Even i'm not getting anything in the log, unless I put the log line before if statement !
Thanks - The_Bhattman
Nimbostratus
Hi Wassim,
Is your "CGNO" a datagroup or defined within topology?
Bhattman - wassim
Altostratus
Hi Bhattman ,
It's defined within topology:
Global Traffic ›› Topology : Regions
Not sure what data group is!
-W - wassim
Altostratus
Hey guys,
It's working now. I followed this thread: "GTM iRule help with matchregion?"
http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/1174529/showtab/groupforums/Default.aspx1225408
Thanks for Banyan,
Here what i did according to Banyan's example:
when DNS_REQUEST {
if { [matchregion ldns CGNO]}{
host 1.1.1.1
log local2. "**** Request from [IP::client_addr]****"
}
else { host 2.2.2.2
log local2. "****Request from [IP::client_addr] ****"
}
} - vinceKahn_97184Historic F5 AccountThanks everyone, finally got back here after being off most of last week. Here's what worked based on the examples above:
when DNS_REQUEST {
if { [matchregion ldns Parkwood] } {
log local0. "[IP::client_addr]"
host 10.1.1.1
}
} - Ferg_104721
Nimbostratus
Also may be useful
https://devcentral.f5.com/community/group/aft/1170857/asg/39
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
