Forum Discussion

jackster_47376's avatar
jackster_47376
Icon for Nimbostratus rankNimbostratus
Feb 25, 2015

Need IRule to insert GeoIP into XFF

I'm trying to implement the new GeoIP feature on my LTM and want to insert all GeoIP information available into the XFF header. Here is my code so far but I need to add, continent, country and state as well. Any help would be appreciated:

 

when HTTP_REQUEST { if {[HTTP::header exists X-Forwarded-For]}{ HTTP::header replace X-Forwarded-For "[HTTP::header X-Forwarded-For], [IP::client_addr]" } else { HTTP::header insert X-Forwarded-For [IP::client_addr] } }

 

1 Reply

  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus

    Just a quickie on that. I believe the license that the GeoIP is provided on precludes you from adding Geo information and passing it to backends... You're only allowed to act on the information within the BigIP itself.

     

    I think you CAN do this is you've added an extra license IIRC... but I'm not sure what exactly that extra was.

     

    H