Forum Discussion
GTM iRule - answering DNS based on some criteria.
Hi guys,
Thank you both for your suggestions.
@Stephan
I just did a small tweak to get this working, as it was complaining about a missing statement:
when DNS_REQUEST {
switch [IP::remote_addr] {
"10.10.100.0/24" {
if {[LB::status vs LInk_Test_GTM] eq "up" } {
host 1.1.1.1
} else {
host 2.2.2.2
}
}
"10.10.200.0/24" {
if {[LB::status vs LInk_Test_GTM] eq "up" } {
host 1.1.1.1
} else {
host 2.2.2.2
}
}
"10.10.10.10" {
if {[LB::status vs LInk_Test_GTM] eq "up" } {
host 1.1.1.1
} else {
host 2.2.2.2
}
}
}
}
@Brad
Tried this way as well, but I get "invalid IP address" error. With the "$" sign syntax is accepted, but I am observing errors in the GTM log (this is probably valid for predefined variables within the iRule only). Data groups option is only available from DNS>Delivery>iRules>Data Group List, but I need the iRule to be created/applied on GSLB section where DGL is missing (there is only GSLB>iRules available). Unless there is a way to create them "on the fly" within the iRule...
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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