Jim_Mathers_131
Jun 10, 2015Nimbostratus
GTM iRule to return CNAMEs based on LB_SELECTED
Hello,
Just want to make sure my iRule beneath my signature is correct. My intent:
- If the GTM chooses server 1.1.1.1, return cname "foo1.bar.com".
- If the GTM chooses server 2.2.2.2, return cname "foo2.bar.com"
- If the GTM chooses another server not equal to 1.1.1.1 or 2.2.2.2, return that server's IP address directly to the LDNS client.
Will this work?
Thanks, Jim
when LB_SELECTED {
if {[LB::server addr] equals "1.1.1.1"} {
persist enable
cname "foo1.bar.com"
}
elseif {[LB::server addr] equals "2.2.2.2"} {
persist enable
cname "foo2.bar.com"
}
}