Forum Discussion

jdevpros's avatar
jdevpros
Icon for Nimbostratus rankNimbostratus
May 25, 2017

How to send client ip to the backend, if we use iRule to map different context

Hi, Our scenario is Real Server a & b /context1 on port 8080, real server a & b /context2 on port 8081, and the big ip has a iRule to balance between this real server on the same port. I mean the user use or context2, to do this we configure iRule to balance depends of the context, but today the real client ip stay on f5.

 

No we need to send this real client ip to the backend server's, we try to disable automap but didn't work.

 

  • This is our iRule

    when HTTP_REQUEST { if {[HTTP::uri] contains "context1"}{ persist dest_addr pool context1_pool return}

      if { [HTTP::uri] contains "context2"}{
      pool context2_pool
      return}
    
      if { [HTTP::uri] contains "context3"}{     
      pool context3_pool
      return}
     }
    
  • Enable X-Forward option in custom HTTP profile & attached to VIP to send client IP address to server.

     

    • jdevpros's avatar
      jdevpros
      Icon for Nimbostratus rankNimbostratus

      But this is a header, so is possible to see the client ip like the client connect directly to real's server's? I mean, if we use netstat -an | grep client_ip

       

    • Samir_Jha_52506's avatar
      Samir_Jha_52506
      Icon for Noctilucent rankNoctilucent

      You can check client IP with command tmsh Show sys connection | grep vip_ip