Forum Discussion
Abhilash_Paul_2
Aug 28, 2017Nimbostratus
Enable source IP persistence based on X forwarded IP info
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 arc...
Jad_Tabbara__J1
Aug 29, 2017Cirrostratus
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
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