Forum Discussion
Kamao
Nimbostratus
Apr 16, 2014FAILED selecting pool based on DNS reverse lookup result.
Hi,
I want to select pool based on DNS reverse lookup result for SMTP connection, but it not worked and following log appeared in /var/log/ltm.
iRUle:
when CLIENT_ACCEPTED {
NAME::lookup @ [IP...
Kamao
Nimbostratus
Apr 17, 2014Hi, nitass, thank you for your answer!
I tried below:
when CLIENT_ACCEPTED {
NAME::lookup @DNS_SERVER_IP [IP::client_addr]
node 172.17.20.104:8080 down node
}
when NAME_RESOLVED {
set ptr [string tolower [NAME::response]]
log local0. "[IP::client_addr]:[TCP::client_port]: Lookup result: $ptr"
if { $ptr ends_with ".jp" } {
set pool_name SMTP_AUTH_Pool
} else {
set pool_name SMTP_Fallback_Pool
}
}
when LB_FAILED {
log local0. "LB_FAILED triggered."
LB::reselect pool $pool_name
}
when SERVER_CONNECTED {
log local0. "SERVER_CONNECTED triggered. Pool is $pool_name."
}
It worked!! but sometime it failed, and logged below.
Apr 17 09:00:05 local/tmm1 err tmm1[5277]: 01220001:3: TCL error: dns_reverse_lookup_test - can't read "pool_name": no such variable while executing "LB::reselect pool $pool_name"
I think it is due to the timing of processing NAME_RESOLVED and LB_FAILED. If NAME_RESOLVED is processed earlier than LB_FAILED, it succeeds, but if NAME_RESOLVED is processed after than LB_FAILED, it fails.
I think it seems that our BIGIP should be upgraded to non-affected version to use RESOLV::lookup.
Thanks so much, nitass!
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects