Forum Discussion
William_Benett1
Nimbostratus
Oct 20, 2006LB based on DNS response?
Hi folks,
I'm trying to write an iRule to perform a DNS lookup on the IP address of the client, and based on something contained in the reverse, make a load balancing decision.
Ini...
William_Benett1
Nimbostratus
Oct 24, 2006It took me a while, but I figured it out.
This code seems to work:
when CLIENT_ACCEPTED {
NAME::lookup [IP::client_addr]
}
when NAME_RESOLVED {
if { [NAME::response] contains "abc.com"} then {
LB::detach
pool www-pool2
} else {
LB::detach
pool www-pool1
}
}
The key is detaching the LB pool before assigning a new one.
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
