Forum Discussion
Mariusz_B
Jan 22, 2015Nimbostratus
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...
- Brad_ParkerJan 22, 2015CirrusIf the switch method is working that's all that matters, its more than ok to do it that way. I think with the small list you are working with here it would actually be a little more efficient using the switch, though it would probably be a negligible performance difference.
- Mariusz_BFeb 02, 2015NimbostratusThank you Brad once again! Sorry for late reply.