Reputation: 3105
We use F5 today but i'm not an expert. We use them for our IIS web farm.
I was wondering if there was a header to force the F5 to send all traffic to a specific host. Or if there is a way to programatically add this feature?
Upvotes: 0
Views: 1187
Reputation: 710
welcome to the world of F5!
You can use cookie persistence to accomplish this which is passive, the BIG-IP just adds a cookie on the traffic sent to the client so when the next request comes in it can map that back to the correct server. You can also do this with source or destination IP persistence as well.
But if you want the BIG-IP to inspect a header and send all traffic to a particular host, yes, you can do this with an iRule. You can do that with all the logic on the BIG-IP, or a combination of logic from the app server which inserts the header with the server IP and port (assuming a format of x.x.x.x:y) and then just use a client-side iRule to inspect and direct. And example of that would be:
when HTTP_REQUEST {
if { [HTTP::header exists MY-SPECIFIC-HOST-HEADER] } {
set poolmem_ip [getfield [HTTP::header MY-SPECIFIC-HOST-HEADER] ":" 1]
set poolmem_port [getfield [HTTP::header MY-SPECIFIC-HOST-HEADER] ":" 2]
pool MYPOOL member $poolmem_ip port $poolmem_port
}
}
where MY-SPECIFIC-HOST-HEADER is whatever you decide to call the header, and MYPOOL is the pool defined on BIG-IP with your specific host as a member.
Upvotes: 2