GTM response according to source ip
Hi,
I have GTM configuration running properly. The devices can talk to each other, get update about the availability of pools.
I need to make another enhancement though. I need a configuration that it will answers the requests according to source ip address as well.
Here is how my irule looks :
when DNS_REQUEST { if { ( [active_members DC-DENEME] >= 1) } { if { ( [IP::addr [IP::client_addr] equals 192.168.5.1/32]) } { log local0. "dns query from local network: <[IP::client_addr]>" host 192.168.71.150 } elseif { [IP::addr[IP::client_addr] not equals 192.168.5.1/32] } { host 1.1.1.1 } } elseif { [active_members DR-DENEME] >= 1 } { host 10.0.71.150 } }
My algorithm is like this : If DC is active calculate the source ip address and respond accordingly. Else its always 10.0.71.150
I have seen under /var/log/gtm :
Oct 13 14:58:12 dcf51 err tmm[10396]: 011a7001:3: TCL error: Rule /Common/DC-DENEME_IRULE - invalid command name "IP::addr192.168.5.199" while executing "IP::addr[IP::client_addr] not equals 192.168.5.1/32"
My clients ip address is 192.168.5.199. I thought IP::addr was irrelevant and removed that.
Then i receive that error :
Oct 13 15:07:14 dcf51 err tmm1[10396]: 011a7001:3: TCL error: Rule /Common/DC-DENEME_IRULE - invalid command name "192.168.5.199" while executing "[IP::client_addr] equals 192.168.5.1/32"
So its all about the syntax of this if condition: What am i doing wrong?
if { ( [IP::addr [IP::client_addr] equals 192.168.5.1/32]) }
Kind regards