Forum Discussion
rashmikantsngh1
Nimbostratus
Aug 22, 2018Need help with insert-true-client-ip-header rule on F5
Hello Experts,
Could you please help me understand below irule configuration step by step for each statement?
I have brief idea about what it does but i'm getting confused in understanding it....
Lee_Sutcliffe
Nacreous
Aug 22, 2018Hope this makes sense:
when HTTP_REQUEST {
if the client address (https://devcentral.f5.com/wiki/iRules.IP__remote_addr.ashx)
is NOT equal to an entry in datagroup akamai-secure-prod-net
and the client address is NOT equal to an entry in datagroup akamai-secure-stage-net
if { not ([class match [IP::remote_addr] eq akamai-secure-prod-net]) and not ([class match [IP::remote_addr] eq akamai-secure-stage-net]) } {
Check the header 'True-Client-IP' exists
if { [HTTP::header exists True-Client-IP] } {
if true, remove the header
HTTP::header remove True-Client-IP
}
insert header with a value of the client IP address
getfield will return the value for the client IP address
up to the first '%' symbol = in this case it will be used for a route domain
https://devcentral.f5.com/wiki/irules.getfield.ashx
HTTP::header insert True-Client-IP [getfield [IP::client_addr] "%" 1]
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
