28-Aug-2017 10:31
I am looking to enable source ip persistence on Virtual server A based with X forwarded IP information sent by another Virtual server B. both virtual server residing on different F5s
My architecture is virtual server A(Internet facing F5) ---> Linux revers proxies--> virtual server B (Internal F5)---> Actual pool members
Any help highly appreciated
29-Aug-2017
03:47
- last edited on
03-Jun-2023
09:44
by
JimmyPackets
Hello Paul,
You can do it by different manner. One of them consist of :
1) From VS_A : Add the "X-Forwarded-For" header using either the HTTP profile or by adding an irule that insert this header.
when HTTP_REQUEST {
HTTP::header insert X-Forwarded-For [IP::remote_addr]
}
Reference : https://support.f5.com/csp/article/K4816
2) From VS_B : You will need to add the following irule, that will use "Universal persistance" on XFF header
when HTTP_REQUEST {
set clientip ""
if { [HTTP::header exists "X-Forwarded-For"] } {
set clientip [HTTP::header "X-Forwarded-For"]
} else {
set clientip [IP::client_addr]
}
persist uie $clientip
}
when HTTP_RESPONSE {
persist add uie $clientip
}
Reference : https://devcentral.f5.com/questions/universal-persistence-with-x-forwarder-47038
Please give us a feedback.
Hope it helps
Regards