Forum Discussion

JMart_143192's avatar
JMart_143192
Icon for Nimbostratus rankNimbostratus
Jul 30, 2015

HELP - iRule for send the real source IP and nationality on the header

Hello everyone.

I'm needing help with make an iRule for send the source IP and nationality on the header to my backend servers.

I think that this iRule works for send the real source IP address of the client:

when HTTP_REQUEST {HTTP::header insert X-Forwarded-For [IP::remote_addr]}

Anyone knows if is possible to add the nationality and how?

Thanks very much for your time!

1 Reply

  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus

    Although the iRule should work for inserting the XFF-header I would recommend using the built-in feature for this:

    Local Traffic >> Profiles : Services : HTTP >>

    There's an option called "Insert X-Forwarded-For" you can enable.

    As for the country code, this can be done with the whereis command. wiki page

    However, it would be a violation of the Term of Use to make that information available 'off-box' (e.g. by relaying it to a back-end server). For that use-case you will need to purchase a license directly from the geo-location data provider.