Forum Discussion

lorenze_383868's avatar
lorenze_383868
Icon for Nimbostratus rankNimbostratus
Feb 15, 2019

Log Client IP in IIS

Hello Cool People,

 

I'm fairly new to F5 and I have this task to get the client IP to be visible on the IIS log. I did check the log and only see the F5 IP in there. I tried adding XFF on the IIS logging as describe on this article. https://blogs.msdn.microsoft.com/webapps/2018/09/05/how-to-log-client-ip-when-iis-is-load-balanced-the-x-forwarded-for-header-xff/ but after applying it, it still is showing the F5 ip. Are there necessary changes in the F5 side to get this to work?

 

Thanks!

 

2 Replies

  • The F5s also need to be configured for x-forwarded-for. There are several methods, creating an X-forwarded-for HTTP profile and applying it to the virtual server, using an iRule with an HTTP profile, using APM, etc.

     

    iRule when HTTP_REQUEST { HTTP::header insert X-Forwarded-for [IP::client_addr] }

     

    HTTP Profile: Create a new HTTP profile ->Profiles->Services->HTTP Select "Create" and name your profile using HTTP as the parent profile. Select "Insert x-forwarded-for" and enable. Click "Finished"

     

    Apply the default HTTP profile and the iRule to your virtual server --OR-- Apply the newly created HTTP profile to your virtual server

     

  • Hi lorenze,

     

    Thats a very good article for the IIS servers. But you have to also make sure that the LTM is really preserving the actual Ip's.

     

    Refer this article and follow accordingly.