Forum Discussion

DavidWong_10382's avatar
DavidWong_10382
Icon for Nimbostratus rankNimbostratus
Nov 03, 2009

About SNAT

Hi Guys,

 

 

If SNAT is used, how to know the original client IP when F5 receives response from server and before sends response back to client? does someone happen to know it. Thanks.

 

 

I tried following cmds, none of them works.

 

IP::client_addr

 

IP::local_addr

 

IP::remote_addr

 

IP::server_addr

5 Replies

  • Hi David,

     

     

    Check this post for details on the various IP::*addr commands in client and serverside events:

     

     

    IP::source_addr?

     

    http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&tpage=1&view=topic&postid=1018710235

     

     

    If you have questions on this, please reply here for more info.

     

     

    Thanks,

     

    Aaron
  • basically ,SNAT is enabled for client IPs, i need to know the original client IP when F5 receives SIP_RESPONSE from server(node), i tried many times, it seems all those cmds IP::xx_addr return NAT address, not the original client IP. should other event be captured ? any suggestion is welcome. thanks.
  • Can you try IP::client_addr in CLIENT_ACCEPTED and compare that with IP::client_addr in the event you're trying to get the client IP address is? IP::client_addr is a synonym for clientside {IP::remote_addr} and should return the source IP address LTM received on the client to LTM connection. If it's not returning the IP address you're expecting it's either a bug or a case where you're expecting the wrong IP address.

     

     

    If you run tcpdump on the external VLAN filtering on the VIP address, what do you see as the client IP address for the client you're testing from?

     

     

    Thanks,

     

    Aaron
  • if I use IP::client_addr under event SIP_RESPONSE , it shows below error message.

     

     

    TCL error: SIP_MWI SIP_RESPONSE - Error: No clientside connection established line 1 invoked from within IP::client_addr
  • Sorry, I didn't realise there wouldn't be a clientside connection in SIP_RESPONSE. I haven't worked much with SIP. Per the wiki page (Click here) IP::client_addr isn't a valid command in the event.

     

     

    I'm not sure what the order / context of events there are for SIP connections. Can anyone else shed some light on this?

     

     

    Aaron