Forum Discussion

C_D_18583's avatar
C_D_18583
Icon for Nimbostratus rankNimbostratus
Jul 31, 2006

Extracting client IP at the pool member

I am not sure if I require an Irule or this is strictly a configuration issue . I have a requirement where the application requires the client(source) IP address. How can I pass the source IP to the application?

 

Please advise. Thanks in advance.

 

2 Replies

  • It would be a fairly simple iRule.

    when HTTP_REQUEST {
      HTTP::header insert "Client-Addr" [IP::remote_addr]
    }

    If you don't want to go with the iRule route, you can always enable the "X-Forwarded-For" header option in the associated HTTP profile. This will insert the client address into a "X-Forwarded-For" HTTP header. You'll have to use the iRule if you want a customized header name.

    -Joe
  • Also, you didn't indicate what the pool member application is but note that IIS does not log these custom headers by default. Look here in the Downloads/iControl Code Share section (Click here) for a filter which will enable IIS to log the X-Forwarded-For header that Joe referred to.

     

     

    If you are using something other than IIS then you will have to determine whether these custom headers will show up in the logs by default.

     

     

    Denny

     

     

    (edit) P.S. See this thread (Click here) for further info on non-SNAT'ed configs...