GTM split DNS iRule

Greetings!

I was hoping you guys could scrutinize this iRule. The goal is to have the GTM return internal addresses to internal DNS queries and public addresses to public DNS queries. I also want to avoid having to create “internal only” VSs and Pools on the GTM. I have the following questions:

  1. Will it even work?
  2. What if all pool members are down?
  3. Can you foresee any “gotchas”?
  4. Can you make it better?

I would create a unique iRule for each WIP…

when LB_SELECTED { Check if the client source IP matches a private IP and also check which pool member was chosen. If the client IP is private and the chosen member server name contains “dal-” return the Dallas LTM VIP. If the client IP is private and the chosen member server name contains “ftw-” return the Ft. Worth LTM VIP.

if { ([matchregion ldns private]) && ([LB::server name] contains “dal-”) } { host 172.10.20.6 } elseif { ([matchregion ldns private]) && ([LB::server name] contains “ftw-”) } { host 10.10.20.6 } }

Environment:

  • Active/Active data centers. One in Dallas, the other in Ft. Worth.
  • A GTM and an LTM at each location.
  • Each GTM has WIPs that point to pools that contain both a Dallas and Ft. Worth member (GTM configs are synced).
  • Each GTM pool member has an Address (public IP) and a Translation (LTM VIP).
  • Dallas LTM VIPs = 172.10.20.x. Ft. Worth LTM VIPs = 10.10.20.x.

I failed at formatting the code…sorry

GTM’s Topology load balancing method is supposed to solve the same problem, no?

I have spent the last two hours trying to fix the code formatting problem with no success. I have tried the “preformatted code” button. I have tried every browser and disabled popups. I have reposted here: DevCentral - An F5 Technical Community