08-Oct-2020 01:54
Hello, I am very beginner to iRule creation. In GTM I tried to create irule as below. But getting error.
Our intention is we need to reroute the DNS query to different pool based on client IP and pool availability.
Appreciate any help on this.
when DNS_REQUEST {
if { [IP::addr [IP::client_addr] equals 10.222.152.101/32] or [IP::addr [IP::client_addr] equals 10.222.152.104/32]} and {[active_members LDAP_POOL1_PROD] > 0 } {
then pool LDAP_POOL1_PROD
} elseif { [IP::addr [IP::client_addr] equals 10.235.4.74/32] or [IP::addr [IP::client_addr] equals 10.235.4.75/32]} and {[active_members LDAP_POOL2_PROD] > 0 } {
then pool LDAP_POOL2_PROD
}
else {
pool LDAP_POOL3_PROD
}
}
08-Oct-2020
02:40
- last edited on
04-Jun-2023
21:15
by
JimmyPackets
I have corrected the syntax only. Not checked any other conditions.
when DNS_REQUEST {
if { ([IP::addr [IP::client_addr] equals 10.222.152.101] or [IP::addr [IP::client_addr] equals 10.222.152.104]) and ([active_members LDAP_POOL1_PROD] > 0) } {
pool LDAP_POOL1_PROD
} elseif { ([IP::addr [IP::client_addr] equals 10.235.4.74] or [IP::addr [IP::client_addr] equals 10.235.4.75]) and ([active_members LDAP_POOL2_PROD] > 0) } {
pool LDAP_POOL2_PROD
}
else {
pool LDAP_POOL3_PROD
}
}
08-Oct-2020 03:26
Hello Samir,
Thank you very much for your help on this. 😊