Forum Discussion
Brandon_Burns_8
May 22, 2007Historic F5 Account
routing to a pool based on protocol
I have have a set of optimization servers that I want to route all http traffic to, and I want all other non-http traffic on port 80 to route to a different pool. This is what I have, but when non-http traffic comes through, my else statement never seems to fire.
Is there a more elegant way to accomplish this?
when CLIENT_ACCEPTED {
TCP::collect 1024
log "collecting"
}
when CLIENT_DATA {
if {([TCP::payload] contains "HTTP") }{
log "Optimization"
pool Optimization_Pool
log "Optimization Pool"
}
else {
log "FW"
pool Firewall_Pool
}
TCP::release
}
Thanks for the help.
- hoolio
Cirrostratus
Hi, - Brandon_Burns_8Historic F5 AccountI added the following. log "Payload =[TCP::payload]"
- hoolio
Cirrostratus
I would guess that the client isn't sending the number of bytes you're waiting to collect. Can you lower the collect to 10 or 100 and retest? - Brandon_Burns_8Historic F5 AccountI retested using the following.
- hoolio
Cirrostratus
I'm fairly sure other people have used TCP::collect x in CLIENT_ACCEPTED and TCP::release in CLIENT_DATA, in 9.4. - Brandon_Burns_8Historic F5 AccountI have tried using both 10 as well as no value, and no matter what I use I cannot get the CLIENT_DATA portion of the rule to fire. The rule just hangs before the CLIENT_DATA event.
- Brandon_Burns_8Historic F5 AccountAlso, when I log the TCP::payload length in the CLIENT_ACCEPTED event, I get a 0.
- "TCP::payload length" isn't available until the CLIENT_DAT event. Basically that value is the amount of payload that has been retrieved. When you issue the TCP::collect, method that triggers a collection sometime between exiting the CLIENT_ACCEPTED event and before the CLIENT_DATA event.
- Brandon_Burns_8Historic F5 AccountIs there anything that would keep my CLIENT_DATA event from firing? When I send valid HTTP traffic, the CLIENT_DATA event fires, but when it is non http traffic i never get out of the CLIENT_ACCEPTED event and everything hangs.
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