Forum Discussion
Jeff_Tuthill_10
Nimbostratus
Aug 10, 2009Pool Selection based on client domain name or IP address
So I think this may be an easy one but I am getting stuck on this. I have an application that I want to allow access to if the client has a certain domain name or is coming from a certain IP subnet......
hoolio
Cirrostratus
Aug 11, 2009You could either figure out which IP address ranges comcast uses, or you could depend on their reverse DNS records being valid for all client IP addresses. If you use the first option, you'd define a datagroup just like the stock AOL datagroup and check the IP::client_addr against that datagroup:
when HTTP_REQUEST {
if { [matchclass [IP::client_addr] equals $::DATA_GROUP_NAME] } {
pool pool1
} elseif { [matchclass [IP::client_addr] equals $::comcast_ips] } {
pool pool1
} else {
discard
}
}
Or you could try to do a reverse DNS lookup using the NAME:: commands:
NAME: These commands allow you to resolve names using the DNS subsystem configured on BIG-IP.
http://devcentral.f5.com/wiki/default.aspx/iRules/name
Try searching the iRules forum for NAME_RESOLVED for some examples. There is also an older Codeshare example which may still be relevant:
http://devcentral.f5.com/wiki/default.aspx/iRules/DestinationSnatUsingDNS.html
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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