RiverFish
Dec 03, 2013Altostratus
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:
- Will it even work?
- What if all pool members are down?
- Can you foresee any "gotchas"?
- 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.