Forum Discussion
Atif_Malik_1133
Nimbostratus
Nov 10, 2005(re)Setting remote_addr
I saw several posts on how to get the real client ip to be forwarded as a variable. My problem is slightly different I want to reset the variable REMOTE_ADDR to be the real client address. All the irules I see are for setting a new variable to be the client address or using X_FORWARDED_FOR for the client address.
The irule i came up with is
when HTTP_REQUEST {
HTTP::header replace "REMOTE_ADDR" [IP::remote_addr]
}
but this gives the server the variable HTTP_REMOTE_ADDR as opposed to simply REMOTE_ADDR.
On the backend we are running apache with php, if that make a difference.
- REMOTE_ADDR is actually part of the CGI specification (Click here).
- drteeth_127330Historic F5 AccountJoe is absolutely correct. However, I would expect REMOTE_ADDR in the CGI to be the same as [IP::remote_addr] unless you have configured a SNAT or have OneConnect enabled. So, if you really want REMOTE_ADDR to be the client's address, then disable the SNAT and set the OneConnect source mask to 255.255.255.255. Good luck!
- Atif_Malik_1133
Nimbostratus
We don't have SNAT, and OneConnect is enabled. I am not sure how I would set th OneConnect source mask to 255.255.255.255 ? - Alex_Moundalexi
Nimbostratus
Posted By Joe on 11/10/2005 9:20 AM
- hoolio
Cirrostratus
If you're wanting to modify how Apache logs HTTP headers, I think you can use the LogFormat directive in your httpd.conf. SOL4816 (Click here) has an example: - Alex_Moundalexi
Nimbostratus
Posted By hoolio on 05/23/2007 7:54 AM
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