Forum Discussion
Haluk_Yildirim_
Nimbostratus
Apr 12, 2011Using HTTPClasses vs. iRules path & domain selection
This has been an ongoing discussion at my company and we do get conflicting answers from F5. What we are doing is basic traffic handling / pool selection based on host/FQDN or path and send it to a p...
hoolio
Cirrostratus
Apr 12, 2011Hi Haluk,
Sorry for the conflicting info you've received. HTTP classes were designed for exactly the scenario you've described. To be honest, I'm not certain whether there is special logic built in for current versions to handle multiple HTTP requests to different HTTP classes. To be safe, you can always add a OneConnect profile to ensure each HTTP request is persisted/load balanced to the correct pool member. Or more ideally, you could test this by setting up a test virtual server with two classes. Set one class to filter on URIs ending with 0 and the other as a catch all. Then use curl to make request to a URI of 0 through 9: curl -v http://1.1.1.1/test.[0-9]. Curl will reuse the same TCP connection to send requests to /test0 through /test9. You can use an iRule to log the URI and selected server:
From: http://devcentral.f5.com/wiki/default.aspx/iRules/LogHttpClassSelection.html
when HTTP_REQUEST {
log local0.info "Client [IP::client_addr]:[TCP::client_port] -> [HTTP::host][HTTP::uri]"
}
when HTTP_CLASS_SELECTED {
log local0.info "Client [IP::client_addr]:[TCP::client_port] -> [HTTP::host][HTTP::uri] went to [HTTP::class] HTTP class"
}
when HTTP_CLASS_FAILED {
log local0.info "Client [IP::client_addr]:[TCP::client_port] -> [HTTP::host][HTTP::uri] did not match an HTTP class!"
}
when LB_SELECTED {
log local0.info "Client [IP::client_addr]:[TCP::client_port] -> selected server: [LB::server]"
}
when SERVER_CONNECTED {
log local0.info "Client [IP::client_addr]:[TCP::client_port] -> connected server: [IP::server_addr]:[TCP::server_port]"
}
See this article for details on OneConnect:
http://devcentral.f5.com/wiki/default.aspx/AdvDesignConfig/oneconnect
If you use SNAT on the serverside connections, you could use the default OneConnect profile with a /0 source mask. If you're not using SNAT, then you'd want to create a custom OneConnect profile with a /32 source mask.
Aaron
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