Layer7 API Management

Expand all | Collapse all

Context variable for local GW-IP of the serverside TCP-connection

Jump to Best Answer
  • 1.  Context variable for local GW-IP of the serverside TCP-connection

    Posted 06-23-2017 03:43 AM

    Hi,

    is there a context variable available, which provides the local GW-IP of the serverside TCP-connection?

    Right now, we only found $request.tcp.localIP, but this is for the clientside context. In docops this variable is defined as $<target>.tcp.localIP, but it's not mentioned, which values are available for "<target>". Is there something available for the serverside context?

    Thank you!

     

    Ciao Stefan



  • 2.  Re: Context variable for local GW-IP of the serverside TCP-connection

    Posted 06-23-2017 08:52 AM

    Hi Stefan,

     

    These should help:

     

    ${<target>.tcp.localHost}
    Returns the local (CA API Gateway) side of the TCP connection's hostname, or else the IP address, or else null.

     

    ${<target>.tcp.remoteAddress}
    ${<target>.tcp.remoteIP}


    Either of these variables returns the remote IPv4 or IPv6 address of the TCP connection through which the Message arrived, in conventional (dotted or colon) notation, or null if not known.

     

    The 'Target' is defined here in the below doc. It refers to the request, response or message variable

    Select a Target Message - CA API Gateway - 9.2 - CA Technologies Documentation 

     

    Regards,

    Joe



  • 3.  Re: Context variable for local GW-IP of the serverside TCP-connection

    Posted 06-26-2017 01:05 AM

    Hi Joe,

    thank you for your response, especially for the "Target" documentation-link. But it was not helpful.

    We also tried ${response.tcp.localIP} before, but this seems to be not valid, as the variable was empty or not available at all.

    Following a short background information to better understand my issue/requirement.

    Our GWs have two IP-interfaces, a private and a public one. Depending on the destination-IP and especially the corresponding routing table entry, different outgoing IP-interfaces will be used for the routing assertion (e.g. 10.x.x.x will us the private and 141.x.x.x will use the public IP).

    The API-GW in its role as a reverse proxy is a full proxy and therefor handles two different and independend TCP-connections, one for the clientside context (consumer <-> GW) and one for the serverside context (GW <-> provider).

    I'm looking now for a context-variable, providing IP-information of the serverside context.

    Hope that's clear now.

    Thank you!

     

    Ciao Stefan



  • 4.  Re: Context variable for local GW-IP of the serverside TCP-connection
    Best Answer

    Posted 08-03-2017 12:56 AM

    Hello Stefan,

     

    The variables that you are looking for between the gateway and the back-end do not exist in even the current 9.2 version of the product. I've done some additional testing and was not able to populate what you were needing. Please create an idea on our community so our Product Management team can review. (Note: Make sure to vote for your idea as it does not do it automatically.

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support