Forum Discussion
wassim_97659
Nimbostratus
Feb 17, 2011IP addresses List
Hi guys, 01070151:3: Rule [CNAME-REDIRECT-1] error: line 1: [undefined procedure: class] [class address_list {Thanks
I have GTM 1600 running BIGIP-10.2.0.1707.0.iso , and i want to add IRule for DNS redirect. I have many IP addresses and I want to build a list to be used in the example below instead of adding a line for each IP. Any idea??
when DNS_REQUEST {
if {[IP::addr [IP::client_addr]/24 equals 10.1.1.0] \
or [IP::addr [IP::client_addr]/24 equals 10.1.2.0] \
or [IP::addr [IP::client_addr]/24 equals 10.1.3.0] \
or [IP::addr [IP::client_addr]/24 equals 10.1.4.0]} {
cname "example1.com"} else {
cname "example2.com"}
}
I tried :
class address_list {
host 10.1.1.0
host 10.1.2.0
}
but i get errors:
3 Replies
- hoolio
Cirrostratus
Unfortunately GTM doesn't currently support datagroups so multiple IP::addr checks are necessary. You could open a case with F5 Support to request this feature. If there's an existing RFE ID, they'll add your request to it. If not, they can create one for you.
Aaron - wassim
Altostratus
Hi Aaron,
I find that I can go around it by creating topology record "CGNO" from the GUI [Global Traffic ›› Topology : Regions] and add all IPs to it. Then I use the "matchregion" in my irule as the following:
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] ****"
}
}
I think using the "matchregion" in this example makes it easier to me and to my operation team to update subnets without touching the IRule.
matchregion page: http://devcentral.f5.com/wiki/default.aspx/iRules/matchregion.html
Thanks
-Wassim - hoolio
Cirrostratus
Hi Wassim,
That looks like a great solution. Thanks for posting it.
Aaron
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