Forum Discussion
Dvirus_297774
Dec 13, 2016Altocumulus
I think this is the solution for you:
 
https://devcentral.f5.com/s/articles/xff-universal-persistence-irule
 
Summary:
 
you should create universal persistence profile -> config it with this iRule will take the first IP in case there is multiple IPs:
 
Name: persist_xff_uie
To be used with UIE Persistence Profile
Checks HTTP Request for 'X-Forwarded-For' header and if exists takes the first 'X-Forwarded-For' IP address as sets as
Persist identifier.
If the 'X-Forwarded-For' header does not exist then the client IP address is set as Persist identifier.
when HTTP_REQUEST {
if {[HTTP::header X-Forwarded-For] != ""} then {
persist uie [lindex [ split [lindex [HTTP::header values X-Forwarded-For] 0] "," ] 0]
} else {
persist uie [IP::client_addr]
}
}
Good luck!